Service/TrackingParameterPersister.php
public function persist(Response $response)
    {
        $trackingParameters = $this->trackingParameters->all();

        foreach ($trackingParameters as $trackingParameter => $value) {
            if (
                (null !== $value)
                && (true === in_array($trackingParameter, $this->cookiesToSave))
            ) {
                $response->headers->setCookie(new Cookie(
                    $trackingParameter,
                    $value,
                    new \DateTime('+1 year'),
                    '/',
                    null,
                    false,
                    false
                ));
            }
        }

        return $response;
    }
public function persist(Response $response)
    {
        $trackingParameters = $this->trackingParameters->all();

        foreach ($trackingParameters as $trackingParameter => $value) {
            if (
                (null !== $value)
                && (true === in_array($trackingParameter, $this->cookiesToSave))
            ) {
                $response->headers->setCookie(new Cookie(
                    $trackingParameter,
                    $value,
                    new \DateTime('+1 year'),
                    '/',
                    null,
                    false,
                    false
                ));
            }
        }

        return $response;
    }
public function persist ( Response $ response ) { $ trackingParameters = $ this -> trackingParameters -> all ( ) ; foreach ( $ trackingParameters as $ trackingParameter => $ value ) { if ( ( null !== $ value ) && ( true === in_array ( $ trackingParameter , $ this -> cookiesToSave ) ) ) { $ response -> headers -> setCookie ( new Cookie ( $ trackingParameter , $ value , new \ DateTime ( '+1 year' ) , '/' , null , false , false ) ) ; } } return $ response ; }
Persists tracking parameters in cookies.

@param Response $response

@return Response
Persists tracking parameters in cookies .