Skip to content
Snippets Groups Projects
Commit ca6e1bc6 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #320 from protich/issue/317

Client Login issues - issue #317
parents 1f095bda 74dffb3f
Branches
Tags
No related merge requests found
...@@ -185,7 +185,7 @@ class Client { ...@@ -185,7 +185,7 @@ class Client {
$_SESSION['_client']['token'] = $user->getSessionToken(); $_SESSION['_client']['token'] = $user->getSessionToken();
$_SESSION['TZ_OFFSET'] = $cfg->getTZoffset(); $_SESSION['TZ_OFFSET'] = $cfg->getTZoffset();
$_SESSION['TZ_DST'] = $cfg->observeDaylightSaving(); $_SESSION['TZ_DST'] = $cfg->observeDaylightSaving();
$user->refreshSession(); //set the hash.
//Log login info... //Log login info...
$msg=sprintf('%s/%s logged in [%s]', $ticket->getEmail(), $ticket->getExtId(), $_SERVER['REMOTE_ADDR']); $msg=sprintf('%s/%s logged in [%s]', $ticket->getEmail(), $ticket->getExtId(), $_SERVER['REMOTE_ADDR']);
$ost->logDebug('User login', $msg); $ost->logDebug('User login', $msg);
...@@ -193,11 +193,9 @@ class Client { ...@@ -193,11 +193,9 @@ class Client {
//Regenerate session ID. //Regenerate session ID.
$sid=session_id(); //Current session id. $sid=session_id(); //Current session id.
session_regenerate_id(TRUE); //get new ID. session_regenerate_id(TRUE); //get new ID.
if(($session=$ost->getSession()) && is_object($session) && $sid) if(($session=$ost->getSession()) && is_object($session) && $sid!=session_id())
$session->destroy($sid); $session->destroy($sid);
session_write_close();
return $user; return $user;
} }
......
...@@ -601,10 +601,8 @@ class Staff { ...@@ -601,10 +601,8 @@ class Staff {
$sid=session_id(); //Current id $sid=session_id(); //Current id
session_regenerate_id(TRUE); session_regenerate_id(TRUE);
//Destroy old session ID - needed for PHP version < 5.1.0 TODO: remove when we move to php 5.3 as min. requirement. //Destroy old session ID - needed for PHP version < 5.1.0 TODO: remove when we move to php 5.3 as min. requirement.
if(($session=$ost->getSession()) && is_object($session) && $sid) if(($session=$ost->getSession()) && is_object($session) && $sid!=session_id())
$session->destroy($sid); $session->destroy($sid);
session_write_close();
return $user; return $user;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment