diff options
author | Andrey Andreev <narf@devilix.net> | 2016-01-11 10:58:40 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-01-11 10:58:40 +0100 |
commit | fd5fe1a64c03ae7204a7e72d936215f7a61d8c30 (patch) | |
tree | b935d2f6bf0335c5765b52ac55fac16f75abde54 /system/libraries/Session | |
parent | bffcdc06baed39dbaddaf8706b9d70c3d466047d (diff) |
Fix #4374
Diffstat (limited to 'system/libraries/Session')
-rw-r--r-- | system/libraries/Session/drivers/Session_database_driver.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/system/libraries/Session/drivers/Session_database_driver.php b/system/libraries/Session/drivers/Session_database_driver.php index f2adacb6b..8c4555481 100644 --- a/system/libraries/Session/drivers/Session_database_driver.php +++ b/system/libraries/Session/drivers/Session_database_driver.php @@ -147,6 +147,9 @@ class CI_Session_database_driver extends CI_Session_driver implements SessionHan { if ($this->_get_lock($session_id) !== FALSE) { + // Prevent previous QB calls from messing with our queries + $this->_db->reset_query(); + // Needed by write() to detect session_regenerate_id() calls $this->_session_id = $session_id; @@ -199,6 +202,9 @@ class CI_Session_database_driver extends CI_Session_driver implements SessionHan */ public function write($session_id, $session_data) { + // Prevent previous QB calls from messing with our queries + $this->_db->reset_query(); + // Was the ID regenerated? if ($session_id !== $this->_session_id) { @@ -287,6 +293,9 @@ class CI_Session_database_driver extends CI_Session_driver implements SessionHan { if ($this->_lock) { + // Prevent previous QB calls from messing with our queries + $this->_db->reset_query(); + $this->_db->where('id', $session_id); if ($this->_config['match_ip']) { @@ -320,6 +329,9 @@ class CI_Session_database_driver extends CI_Session_driver implements SessionHan */ public function gc($maxlifetime) { + // Prevent previous QB calls from messing with our queries + $this->_db->reset_query(); + return ($this->_db->delete($this->_config['save_path'], 'timestamp < '.(time() - $maxlifetime))) ? $this->_success : $this->_failure; |