in reply to Re^5: Cookie Problems
in thread Cookie Problems

Yes, when I set the cookie I print the header. Here is the sub for that:

sub setCookie($) { my($session) = @_; my $query = new CGI; $sid = $session->id(); $cookie = $query->cookie(-name => "CGISESSID", -value => $sid, -expires => '+1h'); -path => '/tmp/Sessions'); print $query->header(-cookie=>$cookie);

Then attempt to retrieve the cookie here:

sub retrieveSession($) { my ($query, $session) = @_; $sid = $query->cookie(CGISESSID=>$session->id) || undef; $sid = substr($sid, 10, -8); $session = new CGI::Session(undef, $sid, {Directory=>'/'}); return getUser($session, $sid); }