Skip to content

Commit de8b82c

Browse files
committed
1 parent 9d02cea commit de8b82c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

system/libraries/Session/drivers/Session_database_driver.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ public function read($session_id)
159159

160160
if (($result = $this->_db->get()->row()) === NULL)
161161
{
162+
// PHP7 will reuse the same SessionHandler object after
163+
// ID regeneration, so we need to explicitly set this to
164+
// FALSE instead of relying on the default ...
165+
$this->_row_exists = FALSE;
162166
$this->_fingerprint = md5('');
163167
return '';
164168
}

user_guide_src/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Bug fixes for 3.0.3
1515
-------------------
1616

1717
- Fixed a bug (#4170) - :doc:`Database <database/index>` method ``insert_id()`` could return an identity from the wrong scope with the 'sqlsrv' driver.
18+
- Fixed a bug (#4179) - :doc:`Session Library <libraries/sessions>` doesn't properly maintain its state after ID regeneration with the 'database' driver on PHP7.
1819

1920
Version 3.0.2
2021
=============

0 commit comments

Comments
 (0)