in reply to Re: cgi::session issue with session data retrival
in thread cgi::session issue with session data retrival

Have updated the code as per the suggestion (as updated in the question). Now i am seeing the below error in the second file while retrieving the session data. Can't locate auto/CGI/Session/File/expire.al in @INC (@INC contains: D:/TBD/xampp/perl/lib D:/TBD/xampp/perl/site/lib .) at D:/TBD/xampp/perl/lib/CGI/Session.pm line 258
  • Comment on Re^2: cgi::session issue with session data retrival

Replies are listed 'Best First'.
Re^3: cgi::session issue with session data retrival
by kcott (Archbishop) on Oct 26, 2010 at 19:33 UTC

    Looking through the documentation for CGI::Session, I see that there are a number of formats for new(); none of which equate to what you have in session2.pl:

    my $session = new CGI::Session(undef, $sid, {Directory=>'d:/TBD'});

    Compare that with the equivalent line in session1.pl.

    Also, I'd recommend using the Class->new form instead of the new Class form. Take a look at Indirect Object Syntax in perlobj for a discussion of this. It's a good habit to get into and may save you some grief down the track.

    -- Ken

      it worked after i used CGI::Session->load($sid). Thanks a lot. It worked for a string, now i need to stored a object :). lets see how it works.