You are here

public function SessionListener::onKernelRequest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/EventListener/SessionListener.php \Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest()

File

vendor/symfony/http-kernel/EventListener/SessionListener.php, line 25

Class

SessionListener
Sets the session in the request.

Namespace

Symfony\Component\HttpKernel\EventListener

Code

public function onKernelRequest(GetResponseEvent $event) {
  if (!$event
    ->isMasterRequest()) {
    return;
  }
  $request = $event
    ->getRequest();
  $session = $this
    ->getSession();
  if (null === $session || $request
    ->hasSession()) {
    return;
  }
  $request
    ->setSession($session);
}