Skip to content

Commit 933043c

Browse files
committed
Resolve session save handler issue
1 parent 2b5fe95 commit 933043c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

system/Session/Handlers/FileHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function read($sessionID): string
187187
}
188188

189189
// Needed by write() to detect session_regenerate_id() calls
190-
if(is_null($this->sessionID))
190+
if (is_null($this->sessionID))
191191
{
192192
$this->sessionID = $sessionID;
193193
}
@@ -206,6 +206,7 @@ public function read($sessionID): string
206206
}
207207

208208
$session_data = '';
209+
clearstatcache(); // Address https://github.com/codeigniter4/CodeIgniter4/issues/2056
209210
for ($read = 0, $length = filesize($this->filePath . $sessionID); $read < $length; $read += strlen($buffer))
210211
{
211212
if (($buffer = fread($this->fileHandle, $length - $read)) === false)

0 commit comments

Comments
 (0)