Steny has asked for the wisdom of the Perl Monks concerning the following question:
To check to see if the cookie was set, I use the following script (check_cookie.cgi):#!c:/perl/bin/perl -wT use CGI; use CGI::Carp qw(fatalsToBrowser); use strict; my $foo = new CGI; my $id_value = 123; my $var = 'someString'; my $cookie_id = $foo->cookie(-name => 'id', -value => "$id_value", -expires => '+18h', -path => '/'); my $cookie_var = $foo->cookie(-name => 'something', -value => "$var", -expires => '+18h', -path => '/'); print $foo->header(-cookie => [$cookie_id, $cookie_var]); print "<A HREF=\"check_cookie.cgi\">Check Cookie</A>\n";
The problem is that the cookie isn't being set. It sets fine on the machine that my website is running on (a Linux box), but the cookies don't seem to set on the computer that I'm attempting to code & test on.#!c:/perl/bin/perl -wT use CGI; use CGI::Carp qw(fatalsToBrowser); use strict; my $foo = new CGI; print $foo->header; my $id = $foo->param('id'); my $var = $foo->param('something'); print "$id<BR><BR>$var";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Setting & Retrieving cookies on WindowsXP problem...
by Abstraction (Friar) on May 02, 2003 at 01:41 UTC | |
by Steny (Sexton) on May 02, 2003 at 03:15 UTC |