From e69d72296cfd9969db569b950721461a521100c4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 1 Mar 2017 09:30:57 -0600 Subject: [PATCH] change formatting of config var --- src/Illuminate/Cookie/CookieServiceProvider.php | 4 +++- src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php | 2 +- src/Illuminate/Session/Middleware/StartSession.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Cookie/CookieServiceProvider.php b/src/Illuminate/Cookie/CookieServiceProvider.php index a6d8b28a9102..7c82dc142e4b 100755 --- a/src/Illuminate/Cookie/CookieServiceProvider.php +++ b/src/Illuminate/Cookie/CookieServiceProvider.php @@ -16,7 +16,9 @@ public function register() $this->app->singleton('cookie', function ($app) { $config = $app->make('config')->get('session'); - return (new CookieJar)->setDefaultPathAndDomain($config['path'], $config['domain'], $config['secure'], $config['sameSite']); + return (new CookieJar)->setDefaultPathAndDomain( + $config['path'], $config['domain'], $config['secure'], $config['same_site'] ?? null + ); }); } } diff --git a/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php b/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php index deaa394ca15a..3a3944ec2afb 100644 --- a/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php +++ b/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php @@ -156,7 +156,7 @@ protected function addCookieToResponse($request, $response) $response->headers->setCookie( new Cookie( 'XSRF-TOKEN', $request->session()->token(), Carbon::now()->getTimestamp() + 60 * $config['lifetime'], - $config['path'], $config['domain'], $config['secure'], false, false, $config['sameSite'] + $config['path'], $config['domain'], $config['secure'], false, false, $config['same_site'] ?? null ) ); diff --git a/src/Illuminate/Session/Middleware/StartSession.php b/src/Illuminate/Session/Middleware/StartSession.php index 972e5e0d4a8b..ca523b934614 100644 --- a/src/Illuminate/Session/Middleware/StartSession.php +++ b/src/Illuminate/Session/Middleware/StartSession.php @@ -177,7 +177,7 @@ protected function addCookieToResponse(Response $response, Session $session) $response->headers->setCookie(new Cookie( $session->getName(), $session->getId(), $this->getCookieExpirationDate(), $config['path'], $config['domain'], Arr::get($config, 'secure', false), - Arr::get($config, 'http_only', true), false, $config['sameSite'] + Arr::get($config, 'http_only', true), false, $config['same_site'] ?? null )); } }