diff options
author | Jonty Sewell <jontysewell@gmail.com> | 2016-02-03 12:41:34 +0100 |
---|---|---|
committer | Jonty Sewell <jontysewell@gmail.com> | 2016-02-03 12:41:34 +0100 |
commit | 4dc17cf59142b3d3d80e9b3cdba77e7db0d2b75c (patch) | |
tree | 5d65fa16ff98496c3c4a8e3cef01cdc272e697a2 /system/libraries | |
parent | e54c461d77ffce9f10999ca51bb2e3932304639b (diff) |
If attempting to write an empty session to Redis, a key will not actually be created, so when the driver tries to set the expiration timeout on the key, 0 is returned, triggering a warning from session_write_close
Signed-off-by: Jonty Sewell <jontysewell@gmail.com>
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Session/drivers/Session_redis_driver.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index c7c574202..aa8459bef 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -240,9 +240,15 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle return $this->_failure; } - return ($this->_redis->setTimeout($this->_key_prefix.$session_id, $this->_config['expiration'])) - ? $this->_success - : $this->_failure; + if($this->_fingerprint === md5('')) + { + // A blank session will not be written to redis, so a timeout cannot be set on it + return $this->_success; + } else { + return ($this->_redis->setTimeout($this->_key_prefix.$session_id, $this->_config['expiration'])) + ? $this->_success + : $this->_failure; + } } return $this->_failure; |