All, I would like to thank you for your help in this problem. I have now figured out the solution. It is in multiple parts.

1) I am running this using Active Perl on a Windows 2008 R2 Server. When specifying the new() or load() methods with undefined attributes, they default to the system temp folder for session file creation and read. What I have discovered is that the default permissions on the "c:\windows\temp" folder are set such that a user level account can traverse folder/execute file, Create files/write data, Create folders/append data; but cannot List folder/read data. So as I was experiencing, the file was being created, but then the load method, even if it had the correct session, did not have permission to actually read the file.

2) The load method was not pulling then CGISESSID from the cookie. I still have not figured out why, but I was able to work around it by pulling the CGISESSID from the cookie myself first, then assigning it in the attributes of the method.

The updated and now working code is below.

script1.pl use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; use CGI::Session ( '-ip_match' ); #my $q = new CGI; my $session = CGI::Session->new(undef, undef, {Directory=>'e:\tmp'} +); $session->param("TestName", "TestValue"); $session->flush(); print $session->header(-location=>'script2.pl'); script2.pl use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; use CGI::Session ( '-ip_match' ); use CGI::Cookie; # fetch existing cookies %cookies = CGI::Cookie->fetch; $sessionid = $cookies{'CGISESSID'}->value; my $session = CGI::Session->load(undef, $sessionid, {Directory=>'e:\ +tmp'}) or die CGI::Session->errstr(); print $session->id . " - " . $session->param('TestName'), "<br>"; print $session->dump() . " <-- Result of dump", "<br>";

In reply to Re: Loading a session from CGI::Session by SitrucHtims
in thread Loading a session from CGI::Session by SitrucHtims

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.