summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-10-18 19:58:38 +0200
committerAndrey Andreev <narf@devilix.net>2015-10-18 19:58:38 +0200
commitde8b82ca8c4e201ad21c07ca962f5480493143eb (patch)
treecc56d6013fa964a1eea5e6a25fcc8911546a8f2a
parent9d02ceafe0aa5ec755f1d8b011cf21f3841191cc (diff)
Fix #4179
-rw-r--r--system/libraries/Session/drivers/Session_database_driver.php4
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 5 insertions, 0 deletions
diff --git a/system/libraries/Session/drivers/Session_database_driver.php b/system/libraries/Session/drivers/Session_database_driver.php
index 1d01c2923..72b39d12d 100644
--- a/system/libraries/Session/drivers/Session_database_driver.php
+++ b/system/libraries/Session/drivers/Session_database_driver.php
@@ -159,6 +159,10 @@ class CI_Session_database_driver extends CI_Session_driver implements SessionHan
if (($result = $this->_db->get()->row()) === NULL)
{
+ // PHP7 will reuse the same SessionHandler object after
+ // ID regeneration, so we need to explicitly set this to
+ // FALSE instead of relying on the default ...
+ $this->_row_exists = FALSE;
$this->_fingerprint = md5('');
return '';
}
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index e3dfac879..950a4a626 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -15,6 +15,7 @@ Bug fixes for 3.0.3
-------------------
- Fixed a bug (#4170) - :doc:`Database <database/index>` method ``insert_id()`` could return an identity from the wrong scope with the 'sqlsrv' driver.
+- Fixed a bug (#4179) - :doc:`Session Library <libraries/sessions>` doesn't properly maintain its state after ID regeneration with the 'database' driver on PHP7.
Version 3.0.2
=============