in reply to cgi session

Looks like you need to use "my" to scope your variables.

use CGI::Session; use CGI; #set up a session my $cgi = CGI->new; my $session = CGI::Session->new("driver:File", $cgi, {Directory=>"./tm +p"}); my $sid = $session->id(); my $cookie = $cgi->cookie(CGISESSID => $session->id); print $cgi->header( -cookie=>$cookie ); $sid = $cgi->cookie("CGISESSID") || undef; $session = new CGI::Session(undef, $sid, {Directory=>'/tmp'});

non-Perl: Andy Ford

Replies are listed 'Best First'.
Re^2: cgi session
by Anonymous Monk on Dec 11, 2006 at 22:06 UTC
    Thanks andy, that seemed to work. Would someone be able to give me a quick explanation of what this actually does, i pieced it together from online examples and trial and error but dont fully understand how it works. Thanks again