in reply to The cookie crumbles
READ COOKIESuse CGI::Cookie; my $c = new CGI::Cookie( -name => 'COOKIENAME', -value => 'Whosyerdaddy', -expires => '+1M', -domain => '.domain.com' ); print "Set-Cookie: $c\n";
I'm not sure why parse returns an array of values for each cookie, but it does. Yes, I could have used map, but I haven't had my coffee yet this morning. :)my %temp = parse CGI::Cookie($ENV{HTTP_COOKIE}); my %cookies; foreach (keys %temp) { $cookies{$_} = shift @{$temp{$_}{value}}; }
Redirect to a simple little script that runs this code. That should tell you how well your cookies worked.print header(); my $debug = 1; # READ COOKIE CODE if ($debug) { foreach (keys %cookies) { print "$_: $cookies{$_}<BR>\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: The cookie crumbles
by Siddartha (Curate) on Oct 24, 2001 at 17:18 UTC |