From e36e287669141a9029035b03002db11346b5443d Mon Sep 17 00:00:00 2001 From: Jack Anderson Date: Mon, 14 Oct 2024 09:24:34 +0100 Subject: [PATCH] Remove cookie on pre install page --- public/install.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/install.php b/public/install.php index a1117cda7..0e1be35a6 100644 --- a/public/install.php +++ b/public/install.php @@ -45,6 +45,14 @@ use Monolog\Logger; require __DIR__ . '/../config/bootstrap.php'; require __DIR__ . '/../vendor/autoload.php'; $log = new Logger('install.log'); +$sessionName = 'SCRMSESSID'; +$sessionId = $_COOKIE[$sessionName] ?? false; +if (!empty($sessionId) && session_status() === PHP_SESSION_ACTIVE) { + session_destroy(); + +} +setcookie($sessionName, false, 1, '/'); + $log->pushHandler(new StreamHandler('../logs/install.log', Logger::DEBUG)); (new InstallPreChecks($log))->setupTwigTemplate();