From 5b0b57fe2c7eba0dc3a1ff738a335124742a2de9 Mon Sep 17 00:00:00 2001 From: ryuring Date: Fri, 6 Dec 2024 12:38:46 +0900 Subject: [PATCH] Update Application.php --- src/Application.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Application.php b/src/Application.php index af06a1976e..5415ec0658 100644 --- a/src/Application.php +++ b/src/Application.php @@ -66,8 +66,8 @@ public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue { $csrfProtectionMiddlewareOptions = ['httponly' => true]; //リクエストがhttpsならcsrfTokenにもsecureヘッダを付与 - $sessionConfig = (array)Configure::read('Session'); - if (!empty($sessionConfig['ini']['session.cookie_secure']) || ini_get('session.cookie_secure') == 1) { + $sessionConfig = (array) Configure::read('Session'); + if (!empty($sessionConfig['ini']['session.cookie_secure']) || (int) ini_get('session.cookie_secure') === 1) { $csrfProtectionMiddlewareOptions['secure'] = true; } $middlewareQueue