in reply to CGI::Session fails to find existing sessions

If your $self->{'cfg'}->param("paths.sessions") is different from the default (/tmp/), it will try to read the sessions from a different directory as where the previous sessions are stored.

Also did you check that the previous sessions created files when you stored them?

Update: since a session ID of undef makes CGI::Session creating a new one, you can omit the condition and simply call something along these lines:

$self->{'s'} = CGI::Session->new( 'driver:file;serializer:default;id:md5', $self->{'q'}, { Directory => $self->{'cfg'}->param("paths.sessions") +}, );

(untested)

Replies are listed 'Best First'.
Re^2: CGI::Session fails to find existing sessions
by hesco (Deacon) on Aug 17, 2009 at 16:40 UTC
    Thank you so much Moritz. That was the clue needed. I had not noticed the new session files littering my /tmp/ directory, though I had noticed (but failed to mention) that expected sessions did not seem available in the configured sessions directory. Your clue explains all the known evidence and seems to have resolved the issue. Thanks again.

    -- Hugh

    if( $lal && $lol ) { $life++; }