Hello all,
For some reason, the simple art of setting and retrieving a cookie is giving
me a problem.
I am using Perl 5.005_03 (using 5.6 is not something I can enforce, unfortunately).
I have one CGI script that sets a cookie using the following code:
$cookie = new CGI::Cookie(-name => 'sessioninfo',
-value => [$query->param('myparam')],
-expires => '+1y',
-path => '/path/to/script',
-domain => '.mydomain.com');
print $query->header(-cookie=>$cookie);
After this code is run, I can see in my Netscape cookies.txt file that the
cookie has been set with the info I expect. However, I am unable to retrieve
the value of the "sessioninfo" cookie with the following code in another
script:
%cookies = fetch CGI::Cookie;
if ($cookies{'sessioninfo'}) {
$id = $cookies{'sessioninfo'}->value;
}
It seems to me that the %cookies hash is not being populated.
Can anyone see my error? I'm pulling the code syntax from perldoc CGI::Cookie.
Thanks!
-Ian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]