s/^Perl/pain/i has asked for the wisdom of the Perl Monks concerning the following question:
This part works FINE. This issue I'm having is HOW to access the EXISTING session on another page. For example, I've include the following code at the top of another page that will check to see if a session has been initialized before proceeding with the displaying the page. However, it NEVER gets the session that has already been created, but, instead, creates nothing:$session = new CGI::Session("driver:File", $cgi, {Directory=>"/temp"}) +; $cookie = $cgi->cookie(-name=>'CGISESSID',-value=>$session->id); $sid = $session->id(); print $cgi->header(-cookie=>$cookie ); # storing data in the session $session->param('sessionid', $session->id); $session->save_param(); # expire the session itself after 1 idle hour $session->expire('+1h');
I know this is simple to some of you, but I just can't seem to get this basic functionality working :-( EXAMPLES PLEASE????use DBI; use CGI; use CGI::Session; $session = CGI::Session->retrieve(); if ($session eq "") { print "Content-type: text/html\n\n"; print "<body>"; print "You must login first!"; exit; print "</body>"; print "</html>"; }
|
|---|