AndyH has asked for the wisdom of the Perl Monks concerning the following question:

After upgrading from Perl 5.8.0 to 5.8.3 on Debian stable (2.4.23), code that was working perfectly well using CGI::Session has stopped working.

When initialising a new session, the random sessid is generated and the basic info written to the session file, so there isn't a perms problem.

After getting the info back from the login form and saving it the session, the file ends up zero length so, even though the cookie is correctly sent back by the client after the login, the session info cannot be read and CGI::Session generates a new session id and presents the login form again. This all works without problem on the box with perl 5.8.0.

Any suggestions?

Thanks

AndyH

  • Comment on Problem with CGI::Session creating empty session files after upgrading from Perl 5.8.0

Replies are listed 'Best First'.
Re: Problem with CGI::Session creating empty session files after upgrading from Perl 5.8.0
by Arunbear (Prior) on Jun 17, 2004 at 23:55 UTC
    Try explicitly flushing the session with $session->flush() at the end of your script (or at least the request handling phase thereof).

      You are a star! That does, indeed, fix it.

      But, any idea why it fixes it? What is it that has changed between 5.8.0 and 5.8.3 that would explain this behaviour??

      Many thanks.

      AndyH

      Sadly, I spoke too soon. It doesn't fix it; in fact, it makes no difference to the behaviour at all.

      sigh.

      AndyH.

      Update: it does, after all, fix the problem; but only after I deleted all the stored session files and the cookies on the client.

      Would still like to know why it fixed the problem ...

      AndyH