parameterBag = $parameterBag; $this->cookieComponent = $cookieComponent; } public function setCookieMerchantCurrent($response, MerchantInterface $merchant) { $response->headers->setCookie( Cookie::create( $this->parameterBag->get('app.cookie_name_merchant_current'), $merchant->getId(), 0, '/', $this->cookieComponent->getCookieDomain() ) ); } }