Subject: | Replace Cookie After Removing Session |
Using CGI::Session w/ Postgres 8.4
Steps:
1) Load CGI page, which creates a session cookie
2) Check database to assure session was created there
3) Delete from database
4) Refresh CGI page
-- A new session is created, but the old cookie is not replaced in the
browser. This occurs whether using print $cgi->header or $session->header
-- A similar issue on
StackOverflow:http://stackoverflow.com/questions/3327152/really-weird-cookie-header-behaviour-cookies,
showed that setting the path/domain helped; but it does not for me (I
explicitly set the domain, and kept the path at default:"/")
-- Something interesting with the cookie object:
my $cookie_name = "foo";
my $cookie_old = $cgi->cookie($cookie_name);
my $cookie_new = new CGI::Cookie( -name => "$cookie_name"
, -value => $session->id()); #verified
new sid
print $cgi->header(-cookie=>$cookie_new); #$session->header();
even if the cookie is deleted on the guest machine, then when the page
is refreshed the cookie is not recreated.