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 {