protected function setAuthenticationCookie(Request $request, Response $response, $token)
    {
        $response->setVary('Cookies', false)->setMaxAge(0)->setPrivate();
        $response->headers->setCookie(
            new Cookie(
                $this->app['token.authentication.name'],
                $token,
                time() + $this->getOption('general/cookies_lifetime'),
                $request->getBasePath(),
                $this->getOption('general/cookies_domain'),
                $this->getOption('general/enforce_ssl'),
                true
            )
        );

        return $response;
    }
protected function setAuthenticationCookie(Request $request, Response $response, $token)
    {
        $response->setVary('Cookies', false)->setMaxAge(0)->setPrivate();
        $response->headers->setCookie(
            new Cookie(
                $this->app['token.authentication.name'],
                $token,
                time() + $this->getOption('general/cookies_lifetime'),
                $request->getBasePath(),
                $this->getOption('general/cookies_domain'),
                $this->getOption('general/enforce_ssl'),
                true
            )
        );

        return $response;
    }
protected function setAuthenticationCookie ( Request $ request , Response $ response , $ token ) { $ response -> setVary ( 'Cookies' , false ) -> setMaxAge ( 0 ) -> setPrivate ( ) ; $ response -> headers -> setCookie ( new Cookie ( $ this -> app [ 'token.authentication.name' ] , $ token , time ( ) + $ this -> getOption ( 'general/cookies_lifetime' ) , $ request -> getBasePath ( ) , $ this -> getOption ( 'general/cookies_domain' ) , $ this -> getOption ( 'general/enforce_ssl' ) , true ) ) ; return $ response ; }
Set the authentication cookie in the response.

@param Request  $request
@param Response $response
@param string   $token

@return Response
Set the authentication cookie in the response .