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


In reply to Re^2: Problem with CGI::Session module -- Getting a new session every time by larryp
in thread Problem with CGI::Session module -- Getting a new session every time by larryp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.