public function onRequest(GetResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        if (!$session = $event->getRequest()->getSession()) {
            return;
        }

        if ($this->debugLoggedOff || ($session->isStarted() && $session->has('authentication'))) {
            $this->dispatcher->addSubscriber($this->listener);
        }
    }