diff options
-rw-r--r-- | system/libraries/Session/drivers/Session_memcached_driver.php | 7 | ||||
-rw-r--r-- | system/libraries/Session/drivers/Session_redis_driver.php | 1 |
2 files changed, 3 insertions, 5 deletions
diff --git a/system/libraries/Session/drivers/Session_memcached_driver.php b/system/libraries/Session/drivers/Session_memcached_driver.php index 8c01a8783..5e90539d7 100644 --- a/system/libraries/Session/drivers/Session_memcached_driver.php +++ b/system/libraries/Session/drivers/Session_memcached_driver.php @@ -326,11 +326,8 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa continue; } - $result = ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND) - ? $this->_memcached->add($lock_key, time(), 300) - : $this->_memcached->set($lock_key, time(), 300); - - if ( ! $result) + $method = ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND) ? 'add' : 'set'; + if ( ! $this->_memcached->$method($lock_key, time(), 300)) { log_message('error', 'Session: Error while trying to obtain lock for '.$this->_key_prefix.$session_id); return FALSE; diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 3437898de..76bddffd3 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -368,6 +368,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle $result = ($ttl === -2) ? $this->_redis->set($lock_key, time(), array('nx', 'ex' => 300)) : $this->_redis->setex($lock_key, 300, time()); + if ( ! $result) { log_message('error', 'Session: Error while trying to obtain lock for '.$this->_key_prefix.$session_id); |