in reply to Re: accessing session variables across different pages
in thread accessing session variables across different pages
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()?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>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: accessing session variables across different pages
by moritz (Cardinal) on Mar 08, 2009 at 23:47 UTC | |
|
Re^3: accessing session variables across different pages
by Anonymous Monk on Mar 08, 2009 at 23:48 UTC | |
|
Re^3: accessing session variables across different pages
by Your Mother (Archbishop) on Mar 09, 2009 at 03:35 UTC |