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;