Bugzilla – Attachment 150604 Details for
Bug 17427
Replace CGI::Session with Data::Session
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17427: Use JSON serialization
Bug-17427-Use-JSON-serialization.patch (text/plain), 2.21 KB, created by
Kyle M Hall (khall)
on 2023-05-03 16:20:49 UTC
(
hide
)
Description:
Bug 17427: Use JSON serialization
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-05-03 16:20:49 UTC
Size:
2.21 KB
patch
obsolete
>From 098ff7e1c7d85d6a7c3ee272b7d28213d7f5247a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 4 Jun 2021 16:57:45 +0200 >Subject: [PATCH] Bug 17427: Use JSON serialization > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Auth.pm | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index dec1405107..2c57c2cdc7 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1834,15 +1834,16 @@ will be created. > > sub _get_session_params { > my $storage_method = C4::Context->preference('SessionStorage'); >+ my $serializer = q{serialize:JSON}; > if ( $storage_method eq 'mysql' ) { > my $dbh = C4::Context->dbh; > # Note that the doc is wrong, type is required, if not provided it default to File >- return { dbh => $dbh, type => 'serialize:yamlxs;driver:mysql;id:MD5' }; >+ return { dbh => $dbh, type => "driver:mysql;$serializer;id:MD5" }; > } elsif ( $storage_method eq 'Pg' ) { > die "The system preference SessionStorage is set to 'Pg' but this is not supported yet!"; > } elsif ( $storage_method eq 'memcached' and my $memcached = Koha::Caches->get_instance->memcached_cache ) { > return { >- type => 'serialize:yamlxs;driver:Memcached;id:SHA1', >+ type => "driver:Memcached;id:SHA1;$serializer", > cache => $memcached, > }; > } elsif ( $storage_method ne 'tmp' ) { >@@ -1855,14 +1856,14 @@ sub _get_session_params { > } > my $dir = C4::Context::temporary_directory; > my $instance = C4::Context->config('database'); #actually for packages not exactly the instance name, but generally safer to leave it as it is >- return { type => 'serialize:yamlxs;driver:File;id:MD5', directory => "$dir/cgisess_$instance" }; >+ return { type => "driver:File;$serializer;id:MD5", directory => "$dir/cgisess_$instance" }; > } > } > > sub get_session { > my $sessionID = shift; > my $params = _get_session_params(); >- my $session = Data::Session->new( %$params ) || die $Data::Session::errstr; >+ my $session = Data::Session->new( %$params, id => $sessionID ) || die $Data::Session::errstr; > return $session; > } > >-- >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 17427
:
56185
|
56504
|
56572
|
57067
|
60355
|
121337
|
121633
|
121657
|
121658
|
121659
|
150569
|
150570
|
150571
|
150603
|
150604
|
150605
|
150606
|
150633
|
150634
|
150635
|
150636
|
150637
|
150638
|
150639
|
150926
|
150927
|
150928
|
150929
|
150930
|
150931
|
153030
|
153031
|
153032
|
153033
|
153034
|
153035
|
153036
|
153037
|
153038
|
153039
|
153040