From 5f59a70f0247abd40f32220baf02633bc4438337 Mon Sep 17 00:00:00 2001 From: Matt Gilchrist Date: Sat, 6 Nov 2021 05:57:28 +1000 Subject: [PATCH] Fix for PHP Notice: session_start(): A session had already been started (#1063) Fix for PHP Notice: session_start(): A session had already been started - ignoring in var/www/html/baikal/Core/Frameworks/Flake/Framework.php on line 187 --- Core/Frameworks/Flake/Framework.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/Frameworks/Flake/Framework.php b/Core/Frameworks/Flake/Framework.php index 9f88bd1..73f6b9d 100644 --- a/Core/Frameworks/Flake/Framework.php +++ b/Core/Frameworks/Flake/Framework.php @@ -184,7 +184,9 @@ class Framework extends \Flake\Core\Framework { if (!\Flake\Util\Tools::isCliPhp()) { ini_set("html_errors", true); - session_start(); + if (session_status() === PHP_SESSION_NONE) { + session_start(); + } if (!isset($_SESSION['CSRF_TOKEN'])) { $_SESSION['CSRF_TOKEN'] = bin2hex(openssl_random_pseudo_bytes(20)); }