Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Setting and Reading Cookies

by bigjoe11a (Novice)
on Jun 21, 2005 at 02:50 UTC ( [id://468551]=note: print w/replies, xml ) Need Help??


in reply to Re: Setting and Reading Cookies
in thread Setting and Reading Cookies

Ok, I get your idea for your code, I have no idea on what CGI.pm is. Thanks Joe

Replies are listed 'Best First'.
Re^3: Setting and Reading Cookies
by gryphon (Abbot) on Jun 21, 2005 at 03:00 UTC

    Greetings bigjoe11a,

    The CGI module (or CGI.pm to distinguish it from the CGI protocol) is a very core Perl module that helps write CGI scripts and other CGI-like things. For very simple scripts, CGI.pm is a bit overkill, but it's very helpful and useful for anything substantial.

    You can use the module to create Web fill-out forms, do stuff with form content, read/set cookies, muck around with HTTP headers, create HTML... Oh gosh, just read the POD. If you're writing CGI scripts in Perl, use CGI.pm unless you have a good reason not to.

    gryphon
    Whitepages.com
    code('Perl') || die;

      Hay, thanks for the info, I just wanted to tel you that the part you game me to read my cookies works great. I can't under why I can't set any more then one cookie. have any ideas. print $cgi->header( -cookie => $cookie1,$cookie2,$cookie3) This my line that I use. It just doesn't set cookie2 or cookie 3. Thanks Joe
        bigjoe11a, did you try reading the perldoc for CGI that gryphon linked to? I did, and I found the following blurb one or two screens down:
        To create multiple cookies, give header() an array reference:
        $cookie1 = cookie(-name=>'riddle_name', -value=>"The Sphynx's Question +"); $cookie2 = cookie(-name=>'answers', -value=>\%answers); print header(-cookie=>[$cookie1,$cookie2]);
        So for your specific example, try print $cgi->header( -cookie => [$cookie1,$cookie2,$cookie3] ).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://468551]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-28 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found