I can set and read cookies with Javascript and I can read Javascript set cookies with CGI.pm.
However, I cannot set the cookies with CGI.pm.
Neither the cpan docs nor the Lincoln Stein book seem to mention that you need to do anything else to get this to work.
I do not have access to CGI::SESSION so that is not an option.
What are we missing here? One thing that seems odd is the: $query->header statement is printing its output to the browser. Am I missing a setting somewhere?
$query = new CGI;
$c = $query->cookie(-name=>'testCookie',
-value=>'2');
print $query->header(-cookie=> $c);
$testCookie = $query->cookie('testCookie');
print "testCookie = $testCookie <br>";
However, I cannot set the cookies with CGI.pm.
Neither the cpan docs nor the Lincoln Stein book seem to mention that you need to do anything else to get this to work.
I do not have access to CGI::SESSION so that is not an option.
What are we missing here? One thing that seems odd is the: $query->header statement is printing its output to the browser. Am I missing a setting somewhere?
$query = new CGI;
$c = $query->cookie(-name=>'testCookie',
-value=>'2');
print $query->header(-cookie=> $c);
$testCookie = $query->cookie('testCookie');
print "testCookie = $testCookie <br>";