#first we need to clear the anonymous session...
$debug and warn "query id = $q_userid but session id = $s_userid";
$anon_search_history = $session->param('search_history');
- $session->flush;
$session->delete();
+ $session->flush;
C4::Context->_unset_userenv($sessionID);
$sessionID = undef;
$userid = undef;
}
elsif ($logout) {
# voluntary logout the user
- $session->flush;
$session->delete();
+ $session->flush;
C4::Context->_unset_userenv($sessionID);
#_session_log(sprintf "%20s from %16s logged out at %30s (manually).\n", $userid,$ip,(strftime "%c",localtime));
$sessionID = undef;
elsif ( !$lasttime || ($lasttime < time() - $timeout) ) {
# timed logout
$info{'timed_out'} = 1;
- $session->delete() if $session;
+ if ($session) {
+ $session->delete();
+ $session->flush;
+ }
C4::Context->_unset_userenv($sessionID);
#_session_log(sprintf "%20s from %16s logged out at %30s (inactivity).\n", $userid,$ip,(strftime "%c",localtime));
$userid = undef;
$info{'newip'} = $ENV{'REMOTE_ADDR'};
$info{'different_ip'} = 1;
$session->delete();
+ $session->flush;
C4::Context->_unset_userenv($sessionID);
#_session_log(sprintf "%20s from %16s logged out at %30s (ip changed to %16s).\n", $userid,$ip,(strftime "%c",localtime), $info{'newip'});
$sessionID = undef;
if ( $lasttime < time() - $timeout ) {
# time out
$session->delete();
+ $session->flush;
C4::Context->_unset_userenv($sessionID);
$userid = undef;
$sessionID = undef;
} elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) {
# IP address changed
$session->delete();
+ $session->flush;
C4::Context->_unset_userenv($sessionID);
$userid = undef;
$sessionID = undef;
return ("ok", $cookie, $sessionID);
} else {
$session->delete();
+ $session->flush;
C4::Context->_unset_userenv($sessionID);
$userid = undef;
$sessionID = undef;
if ( $lasttime < time() - $timeout ) {
# time out
$session->delete();
+ $session->flush;
C4::Context->_unset_userenv($sessionID);
$userid = undef;
$sessionID = undef;
} elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) {
# IP address changed
$session->delete();
+ $session->flush;
C4::Context->_unset_userenv($sessionID);
$userid = undef;
$sessionID = undef;
return ("ok", $sessionID);
} else {
$session->delete();
+ $session->flush;
C4::Context->_unset_userenv($sessionID);
$userid = undef;
$sessionID = undef;