Skip to content

[5.8] Extract session saving to a method #27771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Illuminate/Session/Middleware/StartSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function handle($request, Closure $next)
// Again, if the session has been configured we will need to close out the session
// so that the attributes may be persisted to some storage medium. We will also
// add the session identifier cookie to the application response headers now.
$this->manager->driver()->save();
$this->saveSession();

return $response;
}
Expand Down Expand Up @@ -205,4 +205,14 @@ protected function sessionIsPersistent(array $config = null)

return ! in_array($config['driver'], [null, 'array']);
}

/**
* Save the session data to storage.
*
* @return void
*/
protected function saveSession()
{
$this->manager->driver()->save();
}
}