public function onKernelResponse(FilterResponseEvent $event)
    {
        if (
            HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()
            ||
            !$this->routeMatcher->match($event->getRequest(), $this->routes)
        ) {
            return;
        }
        $event->getResponse()->headers->setCookie(new Cookie(
            $this->cookieName,
            $this->angularCsrfTokenManager->getToken()->getValue(),
            0 === $this->cookieExpire ? $this->cookieExpire : time() + $this->cookieExpire,
            $this->cookiePath,
            $this->cookieDomain,
            $this->cookieSecure,
            false
        ));
    }
public function onKernelResponse(FilterResponseEvent $event)
    {
        if (
            HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()
            ||
            !$this->routeMatcher->match($event->getRequest(), $this->routes)
        ) {
            return;
        }
        $event->getResponse()->headers->setCookie(new Cookie(
            $this->cookieName,
            $this->angularCsrfTokenManager->getToken()->getValue(),
            0 === $this->cookieExpire ? $this->cookieExpire : time() + $this->cookieExpire,
            $this->cookiePath,
            $this->cookieDomain,
            $this->cookieSecure,
            false
        ));
    }
public function onKernelResponse ( FilterResponseEvent $ event ) { if ( HttpKernelInterface :: MASTER_REQUEST !== $ event -> getRequestType ( ) || ! $ this -> routeMatcher -> match ( $ event -> getRequest ( ) , $ this -> routes ) ) { return ; } $ event -> getResponse ( ) -> headers -> setCookie ( new Cookie ( $ this -> cookieName , $ this -> angularCsrfTokenManager -> getToken ( ) -> getValue ( ) , 0 === $ this -> cookieExpire ? $ this -> cookieExpire : time ( ) + $ this -> cookieExpire , $ this -> cookiePath , $ this -> cookieDomain , $ this -> cookieSecure , false ) ) ; }
Sets a cookie to the response containing the CRSF token.

@param FilterResponseEvent $event
Sets a cookie to the response containing the CRSF token .