in reply to Stumbling through CGI::Session::Auth, what am I missing?

My first idea is to call $s->flush at the end of the script to force session storage.

Do you see any stored sessions in /tmp/?

Replies are listed 'Best First'.
Re^2: Stumbling through CGI::Session::Auth, what am I missing?
by hesco (Deacon) on Oct 08, 2008 at 16:25 UTC
    Twenty-seven cgisession_* files in /tmp since this morning's power failure. Adding $s->flush() as indicated here:

    my $html; if($auth->loggedIn){ $html = showSecretPage($html); } else { $html = showLoginPage(); } $s->flush(); print $s->header; print $html; print STDERR "Found end of script.\n"; 1;
    doe not seem to change the outcome. My latest session looks like:

    $D = {'_SESSION_ID' => '95886e9532f65d07af0436e5df67808e','_SESSION_AT +IME' => 1223482676,'_SESSION_EXPIRE_LIST' => {},'_SESSION_REMOTE_ADDR +' => '127.0.0.1 ','_SESSION_CTIME' => 1223474594};;$D
    But except for its creation and updating its access time, I'm not storing any data in this session which should require a ->flush(), if I understand this properly -- which I probably don't or I would be refactoring my old script into my new module instead of poking around on perlmonks, I guess.

    if( $lal && $lol ) { $life++; }
      Did you ever find a solution to this? I am having the exact same issue. All of the data is stored in $auth successfully, but that data isn't making its way into the session (I'm using MySQL to store the data).