Bug 7810 - C4/Auth.pm - on plack restart session is undefined
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 23 Mar 2012 08:54:25 +0000 (09:54 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 11 Jun 2012 16:11:52 +0000 (18:11 +0200)
So we shouldn't try to delete it. This produces application error
instead of redirection to login page.

I had similar problems with CGI, especially when session in browser
is still active, and one on filesystem or database is already expired.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Solved the problem when my Plack installation started acting up due to
stale cookies.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Auth.pm

index 3cfc69f..c97046a 100644 (file)
@@ -690,7 +690,7 @@ sub checkauth {
         elsif ( $lasttime < time() - $timeout ) {
             # timed logout
             $info{'timed_out'} = 1;
-            $session->delete();
+            $session->delete() if $session;
             C4::Context->_unset_userenv($sessionID);
             #_session_log(sprintf "%20s from %16s logged out at %30s (inactivity).\n", $userid,$ip,(strftime "%c",localtime));
             $userid    = undef;