From ec0f503797d97629875f004d04bdcec3407fe124 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Mon, 4 Mar 2019 12:01:00 -0500 Subject: [PATCH] Extract a method --- Middleware/StartSession.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Middleware/StartSession.php b/Middleware/StartSession.php index 2eaec99..415be6e 100644 --- a/Middleware/StartSession.php +++ b/Middleware/StartSession.php @@ -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; } @@ -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(); + } }