You want to use the CGI module (which comes by default with any reasonably up-to-date version of Perl). Setting a cookie with it is as simple as:
use CGI; my $cgi = CGI->new(); $cookie = $cgi->cookie( -name => 'cookie_name', -value => 'cookie_value', ); # CGI->header also takes care of outputing the Content-type print $cgi->header( -cookie => $cookie );
That's just a basic overview. You'll want to read the complete documentation for the module (linked to above) in order to integrate CGI.pm more fully into your CGI. Most importantly, you'll want to convert your CGI to use CGI.pm's param fetching routines.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
In reply to Re: Help to eat cookie
by hardburn
in thread Help to eat cookie
by webstudioro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |