Only do 1 time isFile() check and use lastModified() method (#25007)
This commit is contained in:
parent
683637a5c0
commit
0879b42001
|
@ -66,9 +66,9 @@ class FileSessionHandler implements SessionHandlerInterface
|
|||
*/
|
||||
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, true);
|
||||
if ($this->files->isFile($path = $this->path.'/'.$sessionId)) {
|
||||
if ($this->files->lastModified($path) >= Carbon::now()->subMinutes($this->minutes)->getTimestamp()) {
|
||||
return $this->files->sharedGet($path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue