in reply to Re: Problem with CGI::Session module -- Getting a new session every time
in thread Problem with CGI::Session module -- Getting a new session every time

Hi Mbeast,

Thanks for the suggestion. I'm actually doing that. The following code:

#-----8<----- my $cgi = new CGI(); my $cookieval = $cgi->cookie( "CGISESSID" ); my $sid = $cgi->cookie( "CGISESSID" ) || $cgi->param( "CGISESSID" +); my $qs = $ENV{ 'QUERY_STRING' }; my ( $varname, $id ) = split( /=/, $qs, 2 ); my $session = new CGI::Session(undef, $id, { Directory => File::Sp +ec->tmpdir() }); my $sid2 = $session->id(); #-----8<----- print $cgi->header(); print "<pre>"; print "<b>COOKIE VAL: </b>" . $cookieval . "<br />\n"; print "<b>SID:", "&nbsp;" x 8, "</b>" . $sid . "<br />\n"; print "<b>SID2:", "&nbsp;" x 7, "</b>" . $sid2 . "<br />\n"; print "<b>ID:", "&nbsp;" x 9, "</b>" . $id . "<br />\n"; print "</pre>\n"; #-----8<-----

Produces this when written immediately after the header on the page:

COOKIE VAL: 5f3495591cbfa4c5ef26baadaaabd120 SID:        5f3495591cbfa4c5ef26baadaaabd120 SID2:       a418ee3ee9fb84b0360ac4496e999429 ID:         5f3495591cbfa4c5ef26baadaaabd120

I know it's not a cookie issue, because the cookie value reported by my browser matches $cookieval, $sid, and $id. Furthermore, if I refresh the page (a script called pagegen.cgi), $cookieval, $sid, and $id all stay the same, while $sid2 changes.

I've been fighting with this for two days now and I'm nearly at my wit's end. :)

Thanks again,

Larry