Bugzilla – Attachment 24158 Details for
Bug 10952
Store anonymous search history in session
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10952: Always flush session after deletion
Bug-10952-Always-flush-session-after-deletion.patch (text/plain), 4.26 KB, created by
Kyle M Hall (khall)
on 2014-01-10 15:51:15 UTC
(
hide
)
Description:
Bug 10952: Always flush session after deletion
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-01-10 15:51:15 UTC
Size:
4.26 KB
patch
obsolete
>From 8f48bbf017a4faca1b364ca1f41a9999564e881c Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 6 Jan 2014 10:00:41 +0100 >Subject: [PATCH] Bug 10952: Always flush session after deletion > >This is recommended in CGI::Session documentation. > >Signed-off-by: Charlene Criton <charlene.criton@univ-lyon2.fr> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Auth.pm | 16 +++++++++++++--- > 1 files changed, 13 insertions(+), 3 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 7bc7bd9..736cb64 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -690,16 +690,16 @@ sub checkauth { > #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; >@@ -712,7 +712,10 @@ sub checkauth { > 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; >@@ -724,6 +727,7 @@ sub checkauth { > $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; >@@ -1201,6 +1205,7 @@ sub check_api_auth { > if ( $lasttime < time() - $timeout ) { > # time out > $session->delete(); >+ $session->flush; > C4::Context->_unset_userenv($sessionID); > $userid = undef; > $sessionID = undef; >@@ -1208,6 +1213,7 @@ sub check_api_auth { > } elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) { > # IP address changed > $session->delete(); >+ $session->flush; > C4::Context->_unset_userenv($sessionID); > $userid = undef; > $sessionID = undef; >@@ -1224,6 +1230,7 @@ sub check_api_auth { > return ("ok", $cookie, $sessionID); > } else { > $session->delete(); >+ $session->flush; > C4::Context->_unset_userenv($sessionID); > $userid = undef; > $sessionID = undef; >@@ -1440,6 +1447,7 @@ sub check_cookie_auth { > if ( $lasttime < time() - $timeout ) { > # time out > $session->delete(); >+ $session->flush; > C4::Context->_unset_userenv($sessionID); > $userid = undef; > $sessionID = undef; >@@ -1447,6 +1455,7 @@ sub check_cookie_auth { > } elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) { > # IP address changed > $session->delete(); >+ $session->flush; > C4::Context->_unset_userenv($sessionID); > $userid = undef; > $sessionID = undef; >@@ -1458,6 +1467,7 @@ sub check_cookie_auth { > return ("ok", $sessionID); > } else { > $session->delete(); >+ $session->flush; > C4::Context->_unset_userenv($sessionID); > $userid = undef; > $sessionID = undef; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10952
:
21482
|
21550
|
22133
|
23618
|
23619
|
23755
|
23756
|
23783
|
23927
|
24137
|
24138
|
24139
|
24156
|
24157
| 24158