From db3cf45ad9dbcbf6a6f270dfb2edd1580bf5a410 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 6 Jan 2023 17:10:12 +0000 Subject: [PATCH] Bug 31908: [21.11.x] Resolve second login with another userid As near as I can tell, the problem is that we don't get a new session because while we flish the session, we don't clear the variable I don't fully understand how this all works, but this seems to work --- C4/Auth.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 2500ce3689..5f4438660c 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -905,6 +905,7 @@ sub checkauth { $anon_search_history = $session->param('search_history'); $session->delete(); $session->flush; + undef $session; C4::Context::_unset_userenv($sessionID); $sessionID = undef; } @@ -1279,7 +1280,7 @@ sub checkauth { $uri->query_param_delete('password'); $uri->query_param_delete('koha_login_context'); print $query->redirect(-uri => $uri->as_string, -cookie => $cookie, -status=>'303 See other'); - exit; + safe_exit; } return ( $userid, $cookie, $sessionID, $flags ); -- 2.30.2