in reply to Lossing session value
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Lossing session value
by Anonymous Monk on Dec 13, 2017 at 19:30 UTC | |
by poj (Abbot) on Dec 13, 2017 at 20:03 UTC |