src/Sulu/Bundle/AudienceTargetingBundle/EventListener/AudienceTargetingCacheListener.php
private function setTargetGroupCookie(Response $response, Request $request)
    {
        $response->headers->setCookie(
            new Cookie(
                static::TARGET_GROUP_COOKIE,
                $request->headers->get(static::TARGET_GROUP_HEADER),
                static::TARGET_GROUP_COOKIE_LIFETIME
            )
        );

        $response->headers->setCookie(
            new Cookie(
                static::VISITOR_SESSION_COOKIE,
                time()
            )
        );
    }
private function setTargetGroupCookie(Response $response, Request $request)
    {
        $response->headers->setCookie(
            new Cookie(
                static::TARGET_GROUP_COOKIE,
                $request->headers->get(static::TARGET_GROUP_HEADER),
                static::TARGET_GROUP_COOKIE_LIFETIME
            )
        );

        $response->headers->setCookie(
            new Cookie(
                static::VISITOR_SESSION_COOKIE,
                time()
            )
        );
    }
private function setTargetGroupCookie ( Response $ response , Request $ request ) { $ response -> headers -> setCookie ( new Cookie ( static :: TARGET_GROUP_COOKIE , $ request -> headers -> get ( static :: TARGET_GROUP_HEADER ) , static :: TARGET_GROUP_COOKIE_LIFETIME ) ) ; $ response -> headers -> setCookie ( new Cookie ( static :: VISITOR_SESSION_COOKIE , time ( ) ) ) ; }
Set the cookie for the target group from the request. Should only be set in case the cookie was not set before.

@param Response $response
@param Request $request
Set the cookie for the target group from the request . Should only be set in case the cookie was not set before .