From 16e498a42eba089f3da9a23f6c91591d1071de56 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 25 Jan 2022 13:55:00 +0000 Subject: [PATCH] Bug 29915: Tiny session adjustments It may be that we need a few additional flushes. And checking the returned session before clearing busc. Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall --- C4/Auth.pm | 11 +++++++---- C4/Search/History.pm | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 404e612ddc..437293b4cb 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -561,9 +561,10 @@ sub get_template_and_user { unless ( $pagename =~ /^(?:MARC|ISBD)?detail$/ or $pagename =~ /^showmarc$/ or $pagename =~ /^addbybiblionumber$/ - or $pagename =~ /^review$/ ) { - my $sessionSearch = get_session( $sessionID || $in->{'query'}->cookie("CGISESSID") ); - $sessionSearch->clear( ["busc"] ) if ( $sessionSearch->param("busc") ); + or $pagename =~ /^review$/ ) + { + my $sessionSearch = get_session( $sessionID ); + $sessionSearch->clear( ["busc"] ) if $sessionSearch; } } @@ -899,6 +900,7 @@ sub checkauth { $session->delete(); $session->flush; C4::Context::_unset_userenv($sessionID); + $sessionID = undef; } elsif ($logout) { @@ -908,6 +910,7 @@ sub checkauth { $session->delete(); $session->flush; C4::Context::_unset_userenv($sessionID); + $sessionID = undef; if ($cas and $caslogout) { logout_cas($query, $type); @@ -945,7 +948,6 @@ sub checkauth { } unless ( $loggedin ) { - $sessionID = undef; $userid = undef; } @@ -1243,6 +1245,7 @@ sub checkauth { $session->param( 'sessiontype', 'anon' ); $session->param( 'interface', $type); } + $session->flush; } # END unless ($userid) # finished authentification, now respond diff --git a/C4/Search/History.pm b/C4/Search/History.pm index df36cb0fbc..fec4f004fd 100644 --- a/C4/Search/History.pm +++ b/C4/Search/History.pm @@ -218,6 +218,7 @@ sub set_to_session { return () unless $session; $session->param( 'search_history', uri_escape( encode_json($search_history) ) ); + $session->flush; } 1; -- 2.39.5