summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorJonty Sewell <jontysewell@gmail.com>2016-02-05 11:33:00 +0100
committerJonty Sewell <jontysewell@gmail.com>2016-02-05 11:33:00 +0100
commita7f9ea28aa40bd036de1cee7a4ec4ab63235fd12 (patch)
treee5e10280848e8deaefa5abc4adfffb31aeed0ace /system
parent74f846890d69e6f5ff5f0bb4268539803242d015 (diff)
Set the _key_exists flag to TRUE when the key does in fact exist. Set it to FALSE if the ID is being regenerated, and set it to TRUE once it's been written.
Signed-off-by: Jonty Sewell <jontysewell@gmail.com>
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Session/drivers/Session_redis_driver.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php
index e62a3c597..be5b37e81 100644
--- a/system/libraries/Session/drivers/Session_redis_driver.php
+++ b/system/libraries/Session/drivers/Session_redis_driver.php
@@ -72,7 +72,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
/**
* Key exists flag
*
- * @var boolean
+ * @var bool
*/
protected $_key_exists = FALSE;
@@ -204,6 +204,10 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
$this->_key_exists = FALSE;
$session_data = '';
}
+ else
+ {
+ $this->_key_exists = TRUE;
+ }
$this->_fingerprint = md5($session_data);
return $session_data;
@@ -237,7 +241,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
return $this->_failure;
}
- $this->_fingerprint = md5('');
+ $this->_key_exists = FALSE;
$this->_session_id = $session_id;
}
@@ -249,6 +253,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
if ($this->_redis->set($this->_key_prefix.$session_id, $session_data, $this->_config['expiration']))
{
$this->_fingerprint = $fingerprint;
+ $this->_key_exists = TRUE;
return $this->_success;
}