summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-07-28 14:16:38 +0200
committerAndrey Andreev <narf@devilix.net>2016-07-28 14:16:38 +0200
commit1748567f5442409d6a8c1e795f56599caff8296e (patch)
tree7587a19c9e4ae4a714ea1a620b0ced12cb05b3f2
parent005ca972ba5056111354d3af6203cc7af047fb39 (diff)
[ci skip] Fix #3919, #4732
-rw-r--r--system/libraries/Session/drivers/Session_memcached_driver.php8
-rw-r--r--user_guide_src/source/changelog.rst2
2 files changed, 3 insertions, 7 deletions
diff --git a/system/libraries/Session/drivers/Session_memcached_driver.php b/system/libraries/Session/drivers/Session_memcached_driver.php
index 88eb4b3a6..99b4d1baa 100644
--- a/system/libraries/Session/drivers/Session_memcached_driver.php
+++ b/system/libraries/Session/drivers/Session_memcached_driver.php
@@ -209,10 +209,7 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
$this->_memcached->replace($this->_lock_key, time(), 300);
if ($this->_fingerprint !== ($fingerprint = md5($session_data)))
{
- if (
- $this->_memcached->replace($key, $session_data, $this->_config['expiration'])
- OR ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND && $this->_memcached->set($key, $session_data, $this->_config['expiration']))
- )
+ if ($this->_memcached->set($key, $session_data, $this->_config['expiration']))
{
$this->_fingerprint = $fingerprint;
return $this->_success;
@@ -220,8 +217,7 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
return $this->_fail();
}
-
- if (
+ elseif (
$this->_memcached->touch($key, $this->_config['expiration'])
OR ($this->_memcached->getResultCode() === Memcached::RES_NOTFOUND && $this->_memcached->set($key, $session_data, $this->_config['expiration']))
)
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index c09c1b592..400b36e09 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -12,7 +12,7 @@ Release Date: Not Released
Bug fixes for 3.1.1
-------------------
-
+- Fixed a bug (#4732) - :doc:`Session Library <libraries/sessions>` triggered errors while writing data for a newly-created sessions with the 'memcached' driver.
Version 3.1.0