in reply to Cookie Hell
if ($ENV{'HTTP_COOKIE'} && $ENV{'HTTP_COOKIE'} =~ /vote/) { $cookie_state = 1; my (@rawCookies) = split (/; /,$ENV{'HTTP_COOKIE'}); my (%cookies); foreach(@rawCookies){ ($key, $val) = split (/=/,$_); $cookies{$key} = $val; } foreach $name (keys %cookies) { $cookie_value = $cookies{$name}; } } else { if ($action =~ /results/ && $poll) { $c1 = new CGI::Cookie(-name => 'vote', -value => [$poll], -expires => '+1M' ); print "Set-Cookie:", $c1, "\n"; } } $c2 = new CGI::Cookie(-name => 'plucker', -value => 'true', -expires => '+1h', -path => '/', -secure => '0', ); $plucker = cookie('plucker'); if (!$plucker) { print header(-cookie=>[$c2]); } else { print header() if ($type ne "Plucker"); }
Also, noticed you mention that you can't 'unset' headers. You certainly can, if you put those headers in a scalar, and undef() them later on, as required. Without code and not knowing your design, I can't say whether this is the right longer-term approach, but it will allow you to 'unset' them at will.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Cookie Hell
by TexasTess (Beadle) on Jul 07, 2002 at 22:52 UTC |