Add in $cgi or you get a new session each time. Get the session id
# Create new session my $session = new CGI::Session("driver:File", $cgi, {Directory => 'ses +'}) or die CGI::Session->errstr;; my $sid = $session->id();
Add the session parameter in here. Use .= to ensure a string and not a file handle.
my $got_file_name .= $cgi->param( 'doc_upload' ) || $session->param( 'doc_uploaded' ) || '';
Write the session to disk with flush
# Store file name to use later. $session->param("doc_uploaded", $got_file_name); $session->flush;
Store the session id in a cookie
my $cookie = $cgi->cookie(CGISESSID => $sid); print $cgi->header(-cookie=>$cookie ), $tmpl->output;
Add sessionid to redirect
pojprint "Location: https://myserver/mini.pl?conf=1;CGISESSID=$sid\r\n +\r\n";
In reply to Re: Lossing session value
by poj
in thread Lossing session value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |