From 318581434842b66ab321b52aedca62368b2e563f Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sat, 6 Oct 2007 16:56:27 -0500 Subject: [PATCH] Adding session storage to the other place sessions are made Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Auth.pm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index e11c5826bf..0d6bcb6831 100755 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -493,12 +493,20 @@ sub checkauth { } } unless ($userid) { -# my $session = new CGI::Session("driver:MySQL", undef, {Handle=>$dbh}); - my $session = new CGI::Session("driver:File", undef, {Directory=>'/tmp'}); + my $storage_method = C4::Context->preference('SessionStorage'); + my $session; + if ($storage_method eq 'mysql'){ + $session = new CGI::Session("driver:MySQL", $sessionID, {Handle=>$dbh}); + } + else { + # catch all defaults to tmp should work on all systems + $session = new CGI::Session("driver:File", $sessionID, {Directory=>'/tmp'}); + } + my $sessionID; - if ($session) { - $sessionID = $session->id; - } + if ($session) { + $sessionID = $session->id; + } $userid = $query->param('userid'); C4::Context->_new_userenv($sessionID); my $password = $query->param('password'); -- 2.39.5