From ecce0fefd6d4069befb58951f0dbf935f622d5e2 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 13 Jan 2023 08:08:43 +0000 Subject: [PATCH] Bug 31908: [21.11.x] Fix Auth.pm Content-Type: text/plain; charset=utf-8 --- C4/Auth.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 20f8d6a681..06463e42d6 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -959,8 +959,9 @@ sub checkauth { } unless ( $userid ) { - #we initiate a session prior to checking for a username to allow for anonymous sessions... - $session ||= get_session("") or die "Auth ERROR: Cannot get_session()"; + if( !$session or !$sessionID ) { # if we cleared sessionID, we need a new session + $session = get_session() or die "Auth ERROR: Cannot get_session()"; + } # Save anonymous search history in new session so it can be retrieved # by get_template_and_user to store it in user's search history after -- 2.30.2