in reply to Cookies Help

You probably should check out the documentation for CGI.pm cookie handling. I'd also recommend reading through my CGI course (link at bottom).

use CGI qw(:standard); # reading a cookie my $cookie_value = cookie( $cookie_name ); # creating a cookie my $cookie = cookie( -name => $cookie_name, -value=> $some_value ); # And setting the cookie (while printing the header) print header( -cookie => $cookie );

The above is a simple example of how to do this. Read the docs for more information about how it works.

Cheers,
Ovid

New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)

Replies are listed 'Best First'.
Re: Re: Cookies Help
by Anonymous Monk on Dec 10, 2002 at 01:38 UTC
    Hey thanks alot,,, but dont you need a module to use CGI.pm,, ??? or am i totaly wrong..hehehe
      yeah, but at this point, CGI.pm is pretty much standard. do something like this to create a cookie:

      use CGI;
      
      $q = new CGI;
      my $cookie1 = $q->cookie(-name => 'test', -value => 'test');
      print $q->header(-cookie => $cookie1); 
      
      create multiple cookies like so: -cookie => [$cookie1, $cookie2]
        Okay ,, thanks,,, that seems to be working.. How can I get that cookie now? so i can check the value and match it?