From 3f5ebd2de15e9ad8a3e86621778969f91d50b479 Mon Sep 17 00:00:00 2001 From: rodude123 Date: Sun, 23 Jan 2022 21:52:01 +0000 Subject: [PATCH] same site cookie to strict --- dist/api/index.php | 5 ++++- src/api/index.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dist/api/index.php b/dist/api/index.php index 7115a5c..5ddbc95 100644 --- a/dist/api/index.php +++ b/dist/api/index.php @@ -12,6 +12,7 @@ use api\projectData; use api\timelineData; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; +use Selective\SameSiteCookie\SameSiteCookieConfiguration; use Slim\Factory\AppFactory; use Selective\SameSiteCookie\SameSiteCookieMiddleware; @@ -20,8 +21,10 @@ $app = AppFactory::create(); // create middleware $app->addRoutingMiddleware(); +$ssConfig = new SameSiteCookieConfiguration(["same_site" => "strict"]); + // add in same site cookie stuff -$app->add(new SameSiteCookieMiddleware()); +$app->add(new SameSiteCookieMiddleware($ssConfig)); // for error checking $errorMiddleware = $app->addErrorMiddleware(true, true, true); diff --git a/src/api/index.php b/src/api/index.php index 7115a5c..5ddbc95 100644 --- a/src/api/index.php +++ b/src/api/index.php @@ -12,6 +12,7 @@ use api\projectData; use api\timelineData; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; +use Selective\SameSiteCookie\SameSiteCookieConfiguration; use Slim\Factory\AppFactory; use Selective\SameSiteCookie\SameSiteCookieMiddleware; @@ -20,8 +21,10 @@ $app = AppFactory::create(); // create middleware $app->addRoutingMiddleware(); +$ssConfig = new SameSiteCookieConfiguration(["same_site" => "strict"]); + // add in same site cookie stuff -$app->add(new SameSiteCookieMiddleware()); +$app->add(new SameSiteCookieMiddleware($ssConfig)); // for error checking $errorMiddleware = $app->addErrorMiddleware(true, true, true);