Skip to content

Commit

Permalink
Merge pull request #2307 from jim-parry/fix/session_save
Browse files Browse the repository at this point in the history
Resolve session save handler issue
  • Loading branch information
jim-parry authored Oct 7, 2019
2 parents 2b5fe95 + 933043c commit 10755eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/Session/Handlers/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function read($sessionID): string
}

// Needed by write() to detect session_regenerate_id() calls
if(is_null($this->sessionID))
if (is_null($this->sessionID))
{
$this->sessionID = $sessionID;
}
Expand All @@ -206,6 +206,7 @@ public function read($sessionID): string
}

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

0 comments on commit 10755eb

Please sign in to comment.