Skip to content

Commit

Permalink
Fix empty session (#15998)
Browse files Browse the repository at this point in the history
Fix session being empty when the file is being read and/or written by multiple instance of apache simultaneously. This append to me when assets (javascript / css) are being loaded dynamically using php. Multiples assets in the same request cause the sessions to be corrupted.
  • Loading branch information
lcharette authored and taylorotwell committed Oct 24, 2016
1 parent 18d26df commit e9ed079
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Session/FileSessionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function read($sessionId)
{
if ($this->files->exists($path = $this->path.'/'.$sessionId)) {
if (filemtime($path) >= Carbon::now()->subMinutes($this->minutes)->getTimestamp()) {
return $this->files->get($path);
return $this->files->get($path, true);
}
}

Expand Down

0 comments on commit e9ed079

Please sign in to comment.