From 763460d2d33a8ff213f972970797002c2c516c7d Mon Sep 17 00:00:00 2001
From: catch <6915-catch@users.noreply.drupalcode.org>
Date: Sat, 31 Aug 2024 08:50:57 +0900
Subject: [PATCH] Issue #3470075 by andypost, ankitv18: PHP 8.4 GET/POST
 sessions are deprecated

(cherry picked from commit 685891702d9c7b9b62dc8304429057283149b3d6)
---
 core/lib/Drupal/Core/DrupalKernel.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index f7c5f359692b..56e2ff8785cc 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -1066,8 +1066,10 @@ public static function bootEnvironment($app_root = NULL) {
       // Use session cookies, not transparent sessions that puts the session id
       // in the query string.
       ini_set('session.use_cookies', '1');
-      ini_set('session.use_only_cookies', '1');
-      ini_set('session.use_trans_sid', '0');
+      if (\PHP_VERSION_ID < 80400) {
+        ini_set('session.use_only_cookies', '1');
+        ini_set('session.use_trans_sid', '0');
+      }
       // Don't send HTTP headers using PHP's session handler.
       // Send an empty string to disable the cache limiter.
       ini_set('session.cache_limiter', '');
-- 
GitLab