in reply to Lossing session value

Why isn't the value in the session available once the Location gets called?

Because you are over-writing it with an empty string here:

my $got_file_name = $cgi->param( 'doc_upload' ) || ''; # Store file name to use later. $session->param("doc_uploaded", $got_file_name);

Replies are listed 'Best First'.
Re^2: Losing session value
by Anonymous Monk on Dec 13, 2017 at 16:49 UTC
    No, that didn't work! Even removing the check for empty value my $got_file_name = $cgi->param( 'doc_upload' ); from the code I am still losing the session value.

      You are not checking for an empty value, you are setting one. And if you don't do that, you are setting it to undef which is just as bad. Here is what I think you should be doing:

      my $got_file_name = $cgi->param( 'doc_upload' ); # Store file name to use later but only if it is defined. $session->param("doc_uploaded", $got_file_name) if $got_file_name; my $filename_uploaded = $session->param("doc_uploaded");
        Still a mystery, it doesn't work, I can't get the value from the session!