in reply to cookie problem

my $expires = "Wed, 09-Nov-2002 00:00:00 GMT"; my $path = "/"; my $domain = "\."."$ENV{'SERVER_NAME'}"; print "Content-type:text/html\n"; print "Set-Cookie: myName=Azuba;"; if ($expires) {print " expires=$expires;";} if ($path) {print " path=$path;";} if ($domain) {print " domain=$domain;";} if ($secure) {print " secure";} print "\n\n";
jtrue

Replies are listed 'Best First'.
Re: Re: cookie problem
by LTjake (Prior) on Oct 16, 2002 at 11:32 UTC
    use CGI, please.

    To store...
    use CGI; use strict; my $q = new CGI; my %cookie_info; $cookie_info{id} = $q->param('id'); my $cookie = $q->cookie( -name => 'cookie_name', -value => \%cookie_info, -path => '/', -expires => '+1h', ); print $q->header(-cookie => $cookie); print 'done.';
    To read...
    use CGI; use strict; my $q = new CGI; my %cookie_info = $q->cookie('cookie_name'); print $q->header; print $cookie_info{id};
    See the CGI docs for more info.

    --
    Rock is dead. Long live paper and scissors!