public function onResponse(FilterResponseEvent $event)
    {
        if (!$event->isMasterRequest() || !$this->session->isStarted()) {
            return;
        }
        $this->session->save();
        $cookie = $this->generateCookie();
        $event->getResponse()->headers->setCookie($cookie);
    }
public function onResponse(FilterResponseEvent $event)
    {
        if (!$event->isMasterRequest() || !$this->session->isStarted()) {
            return;
        }
        $this->session->save();
        $cookie = $this->generateCookie();
        $event->getResponse()->headers->setCookie($cookie);
    }
public function onResponse ( FilterResponseEvent $ event ) { if ( ! $ event -> isMasterRequest ( ) || ! $ this -> session -> isStarted ( ) ) { return ; } $ this -> session -> save ( ) ; $ cookie = $ this -> generateCookie ( ) ; $ event -> getResponse ( ) -> headers -> setCookie ( $ cookie ) ; }
Add the session cookie to the response if it is started.

@param FilterResponseEvent $event
Add the session cookie to the response if it is started .