Okay, I need someone to say me from giving up on Perl to perform this basic task. I've literally taken a code example from CPAN for checking an existing session and it STILL doesn't recognize a session!!!! Here is the code:
use strict; use CGI::Session; use CGI; use CGI::Cookie; print "Content-type: text/html\n\n"; my $cgi = new CGI("CGISESSID"); my $session = CGI::Session->load or die CGI::Session->errstr; print $session->header; if ($session->is_expired) { print $session->header, $cgi->start_html, $cgi->p("Your session timed out. Click here to start a new sessio ++n."), $cgi->end_html; exit(0); } if($session->is_empty) { print $cgi->start_html; print "Click here to sign in"; print $cgi->end_html; exit(0); } print "</body>"; print "</html>";
Problem: I've created a valid session from the another login page. However, when I place the above code at type of another page, it always evaluates to an empty session. I've seen another post similar to this one and not one really answered the question. Is there some conspiracy against using Perl for session management? Should I just throw my hands up and use PHP Session_Start()?

In reply to Re^2: accessing session variables across different pages by s/^Perl/pain/i
in thread accessing session variables across different pages by s/^Perl/pain/i

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.