Bugzilla – Attachment 132234 Details for
Bug 29957
Cookies not removed after logout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29957: Replace clear_all_cookies in Auth.pm
Bug-29957-Replace-clearallcookies-in-Authpm.patch (text/plain), 2.13 KB, created by
Nick Clemens (kidclamp)
on 2022-03-25 12:21:55 UTC
(
hide
)
Description:
Bug 29957: Replace clear_all_cookies in Auth.pm
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-03-25 12:21:55 UTC
Size:
2.13 KB
patch
obsolete
>From 617ba95f81279e1bf9a59250cbaeade3487e749d Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 14 Mar 2022 11:30:57 +0000 >Subject: [PATCH] Bug 29957: Replace clear_all_cookies in Auth.pm > >Test plan: >Enable language selection and have two languages. >Change language. >Check cookie value in browser for KohaOpacLanguage. >Logout. >Verify that cookie has been cleared in browser. > >Add do_not_remove_cookie line for KohaOpacLanguage in koha-conf. >Restart, flush. >Login again. >Change language. >Check cookie value in browser for KohaOpacLanguage. >Logout. >Verify that cookie still contains the language. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Auth.pm | 14 ++++---------- > 1 file changed, 4 insertions(+), 10 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index e2b1d47931..32bef6214a 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -48,6 +48,7 @@ use Encode; > use C4::Auth_with_shibboleth qw( shib_ok get_login_shib login_shib_url logout_shib checkpw_shib ); > use Net::CIDR; > use C4::Log qw( logaction ); >+use Koha::CookieManager; > > # use utf8; > >@@ -807,15 +808,6 @@ sub _timeout_syspref { > return $timeout; > } > >-sub clear_all_cookies { >- my ( $query ) = shift; >- my @cookies; >- for my $cookie_name ( $query->cookie ) { >- push @cookies, $query->cookie( -name => $cookie_name, -value => '', -expires => '', -HttpOnly => 1 ); >- } >- return \@cookies; >-} >- > sub checkauth { > my $query = shift; > >@@ -846,6 +838,8 @@ sub checkauth { > my $dbh = C4::Context->dbh; > my $timeout = _timeout_syspref(); > >+ my $cookie_mgr = Koha::CookieManager->new; >+ > _version_check( $type, $query ); > > # state variables >@@ -921,7 +915,7 @@ sub checkauth { > my $shibSuccess = C4::Context->userenv->{'shibboleth'}; > $session->delete(); > $session->flush; >- $cookie = clear_all_cookies($query); >+ $cookie = $cookie_mgr->clear_unless( $query->cookie, @$cookie ); > C4::Context::_unset_userenv($sessionID); > $sessionID = undef; > >-- >2.30.2
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 29957
:
129871
|
129872
|
130005
|
130006
|
131428
|
131750
|
131751
|
131752
|
131807
|
131808
|
131809
|
131810
|
131824
|
131825
|
131826
|
131827
|
131828
|
131840
|
131841
|
131842
|
131843
|
131856
|
132045
|
132046
|
132047
|
132105
|
132106
|
132107
|
132108
|
132109
|
132110
|
132111
|
132115
|
132210
|
132211
|
132231
|
132232
|
132233
|
132234
|
132235
|
132236
|
132237
|
132238
|
132239
|
132288
|
132289
|
132290
|
132291
|
132292
|
132293
|
132294
|
132295
|
132296