Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: The cookie crumbles

by joealba (Hermit)
on Oct 24, 2001 at 16:29 UTC ( #121087=note: print w/replies, xml ) Need Help??

in reply to The cookie crumbles

First: Change your -domain line to:

     -domain => ''  
You need at least two periods in the domain line (to make sure you don't try to set a domain-wide cookie across a top level domain like .com or something).

Second: I prefer to use CGI::Cookie. I've never had a problem with it.

use CGI::Cookie; my $c = new CGI::Cookie( -name => 'COOKIENAME', -value => 'Whosyerdaddy', -expires => '+1M', -domain => '' ); print "Set-Cookie: $c\n";
my %temp = parse CGI::Cookie($ENV{HTTP_COOKIE}); my %cookies; foreach (keys %temp) { $cookies{$_} = shift @{$temp{$_}{value}}; }
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. :)

print header(); my $debug = 1; # READ COOKIE CODE if ($debug) { foreach (keys %cookies) { print "$_: $cookies{$_}<BR>\n"; } }
Redirect to a simple little script that runs this code. That should tell you how well your cookies worked.

Replies are listed 'Best First'.
Re: Re: The cookie crumbles
by Siddartha (Curate) on Oct 24, 2001 at 17:18 UTC
    Thanks for the info.

    I have solved the problem though. With the general admin on the servers, the server suddenly decided it was 1970 instead of 2001. this is why all my cookies were being killed.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://121087]
Corion idly wonders about creating a series of HTTP requests. There seems to be no framework to generate a series of HTTP requests, like "try all these requests"
[Corion]: This is vaguely inspired by that list of "nasty" strings, which I'd like to replace among HTTP parameters, just to see whether the application crashes, but also for easy downloading of a list of URLs etc
[Corion]: Maybe I'll just conoct something using Algorithm::Permute to create an (OO) generator for such requests, or a simple function.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-01-16 15:36 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (151 votes). Check out past polls.