Skip to content

Commit

Permalink
Extract a method
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Mar 4, 2019
1 parent 15b4d36 commit ec0f503
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Middleware/StartSession.php
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();
}
}

0 comments on commit ec0f503

Please sign in to comment.