Bugzilla – Attachment 129748 Details for
Bug 29915
Anonymous session generates 1 new session ID per hit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29915: Don't generate a new session ID for anonymous navigation
Bug-29915-Dont-generate-a-new-session-ID-for-anony.patch (text/plain), 1.95 KB, created by
Marcel de Rooy
on 2022-01-25 12:52:03 UTC
(
hide
)
Description:
Bug 29915: Don't generate a new session ID for anonymous navigation
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-01-25 12:52:03 UTC
Size:
1.95 KB
patch
obsolete
>From 5d88866d2a9f81a4249e0c31537b9b115f25f9c5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 20 Jan 2022 12:05:11 +0100 >Subject: [PATCH] Bug 29915: Don't generate a new session ID for anonymous > navigation >Content-Type: text/plain; charset=utf-8 > >When a user is not logged in, a new session ID is generated every time a >new page is hit. >--- > C4/Auth.pm | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index dd7d24b1f1..aa2082f8ab 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -913,14 +913,11 @@ sub checkauth { > -secure => ( C4::Context->https_enabled() ? 1 : 0 ), > ); > >- my $sessiontype = $session->param('sessiontype') || ''; >- unless ( $sessiontype && $sessiontype eq 'anon' ) { #if this is an anonymous session, we want to update the session, but not behave as if they are logged in... >- $flags = haspermission( $userid, $flagsrequired ); >- if ($flags) { >- $loggedin = 1; >- } else { >- $info{'nopermission'} = 1; >- } >+ $flags = haspermission( $userid, $flagsrequired ); >+ if ($flags) { >+ $loggedin = 1; >+ } else { >+ $info{'nopermission'} = 1; > } > } > } elsif ( !$logout ) { >@@ -941,7 +938,7 @@ sub checkauth { > > unless ( $userid ) { > #we initiate a session prior to checking for a username to allow for anonymous sessions... >- my $session = get_session("") or die "Auth ERROR: Cannot get_session()"; >+ $session ||= get_session("") or die "Auth ERROR: Cannot get_session()"; > > # Save anonymous search history in new session so it can be retrieved > # by get_template_and_user to store it in user's search history after >-- >2.20.1
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 29915
:
129644
|
129653
|
129683
|
129748
|
129750
|
129751
|
129752
|
129753
|
129754
|
129755
|
129756
|
129822
|
129826
|
129827
|
129828
|
129829
|
129830
|
129831
|
129832
|
129833
|
129860
|
129861
|
129862
|
129863
|
129864
|
129865
|
129866
|
129878
|
129879
|
129880
|
129882
|
129883
|
129884
|
129885
|
129886
|
129887
|
129888
|
129889
|
129906
|
129907
|
129908
|
129909
|
129910
|
129911
|
129912
|
129913
|
129951
|
130596
|
130597
|
130598
|
130599
|
130600
|
130601
|
130602
|
130603
|
130604
|
131708
|
131709
|
131710
|
131711
|
131712
|
131713
|
131714
|
131715
|
131716
|
131788
|
131789
|
131790
|
131791
|
131792
|
131793
|
131794
|
131795
|
131796
|
131797
|
132101
|
132104
|
132114
|
132158
|
132159