J
James
Try to retrieve a cookie from a perl-cgi script, but gets an empty
string for the cookie.
----------------------------------------------------
#!/bin/env perl -w
use CGI qwstandard);
print "Content-type: text/html\n\n";
my $cookie = cookie( -name => 'ID', -value => 'bob');
my $ID = cookie('ID');
print "ID = $ID";
print header(-cookie=>$cookie);
----------------------------------------------------
web-page output:
ID =
Set-Cookie: ID=bob; path=/ Date: Wed, 16 Nov 2005 01:51:06 GMT
Content-Type: text/html; charset=ISO-8859-1
How do I retrieve a cookie?
Thanks in advance.
James
string for the cookie.
----------------------------------------------------
#!/bin/env perl -w
use CGI qwstandard);
print "Content-type: text/html\n\n";
my $cookie = cookie( -name => 'ID', -value => 'bob');
my $ID = cookie('ID');
print "ID = $ID";
print header(-cookie=>$cookie);
----------------------------------------------------
web-page output:
ID =
Set-Cookie: ID=bob; path=/ Date: Wed, 16 Nov 2005 01:51:06 GMT
Content-Type: text/html; charset=ISO-8859-1
How do I retrieve a cookie?
Thanks in advance.
James