From 94f47630bab524331d5fcb5c2fb644b594e2190b Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Sat, 18 Apr 2020 20:51:12 +0200 Subject: [PATCH] Fixed fetching sessionId from InputBag --- .../Component/Security/Http/Firewall/ContextListener.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php index 6f427533f24b..7cf19dbb8565 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php @@ -97,9 +97,10 @@ public function authenticate(RequestEvent $event) if (null !== $session) { $usageIndexValue = $session instanceof Session ? $usageIndexReference = &$session->getUsageIndex() : 0; $usageIndexReference = PHP_INT_MIN; - $sessionId = $request->cookies->get($session->getName()); + $sessionId = $request->cookies->all()[$session->getName()] ?? null; $token = $session->get($this->sessionKey); + // sessionId = true is used in the tests if ($this->sessionTrackerEnabler && \in_array($sessionId, [true, $session->getId()], true)) { $usageIndexReference = $usageIndexValue; } else {