1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 01:25:01 +02:00

Issue #4657 - Improved handling to prevent multiple sessions running on the same user account.

This commit is contained in:
Cameron
2022-01-13 11:18:31 -08:00
parent a617918256
commit fd42d2325f
3 changed files with 16 additions and 11 deletions

View File

@@ -1131,7 +1131,7 @@ class e_session_db #implements SessionHandlerInterface
* @var e_db
*/
protected $_db = null;
/**
* Table name
* @var string
@@ -1145,7 +1145,7 @@ class e_session_db #implements SessionHandlerInterface
public function __construct()
{
$this->_db = e107::getDb('session');
$this->_db = e107::getDb('session');
}
public function __destruct()
@@ -1268,10 +1268,12 @@ class e_session_db #implements SessionHandlerInterface
'data' => array(
'session_expires' => time() + $this->getLifetime(),
'session_data' => base64_encode($session_data),
'session_user' => defset('USERID'),
),
'_FIELD_TYPES' => array(
'session_id' => 'str',
'session_expires' => 'int',
'session_user' => 'int',
'session_data' => 'str'
),
'_DEFAULT' => 'str'
@@ -1280,7 +1282,7 @@ class e_session_db #implements SessionHandlerInterface
{
return false;
}
$check = $this->_db->select($this->getTable(), 'session_id', "`session_id`='{$session_id}'");
if($check)