From 25ebe37eebc0053546b39cb6e60b33186dcbd646 Mon Sep 17 00:00:00 2001 From: Younes ENNAJI Date: Sun, 10 Dec 2023 01:17:56 +0100 Subject: [PATCH] fix(symfony): check if the request if stateless --- src/Symfony/Storage/SessionBag.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Storage/SessionBag.php b/src/Symfony/Storage/SessionBag.php index fb90750a..4ab96c66 100644 --- a/src/Symfony/Storage/SessionBag.php +++ b/src/Symfony/Storage/SessionBag.php @@ -68,7 +68,9 @@ final class SessionBag implements BagInterface $session = $this->session->getCurrentRequest()->getSession(); } - if (null !== $session) { + $isStateless = $this->session->getCurrentRequest()->attributes->has('_stateless'); + + if (null !== $session && !$isStateless) { return $this->session = $session; }