/**
* Reads the Security Token from the session.
*/
public function authenticate(RequestEvent
$event): void
{ if (!
$this->registered && null !==
$this->dispatcher &&
$event->
isMainRequest()) { $this->dispatcher->
addListener(KernelEvents::RESPONSE,
$this->
onKernelResponse(...
));
$this->registered = true;
} $request =
$event->
getRequest();
$session =
$request->
hasPreviousSession() ?
$request->
getSession() : null;
$request->attributes->
set('_security_firewall_run',
$this->sessionKey
);
if (null !==
$session) { $usageIndexValue =
$session instanceof Session ?
$usageIndexReference = &
$session->
getUsageIndex() : 0;
$usageIndexReference = \PHP_INT_MIN;
$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
)) {