// We need to allow it on login, otherwise the state is wrong
if (!
($route === 'frontend.account.login' ||
$request->
getMethod() === Request::METHOD_GET
)) { return;
} if ($context->
getCustomer() ||
$cart->
getLineItems()->
count() > 0
) { $newValue =
$this->
buildCacheHash($context);
if ($request->cookies->
get(self::CONTEXT_CACHE_COOKIE, ''
) !==
$newValue) { $cookie = Cookie::
create(self::CONTEXT_CACHE_COOKIE,
$newValue);
$cookie->
setSecureDefault($request->
isSecure());
$response->headers->
setCookie($cookie);
} } elseif ($request->cookies->
has(self::CONTEXT_CACHE_COOKIE
)) { $response->headers->
removeCookie(self::CONTEXT_CACHE_COOKIE
);
$response->headers->
clearCookie(self::CONTEXT_CACHE_COOKIE
);
} /** @var bool|array{maxAge?: int, states?: list<string>}|null $cache */
$cache =
$request->attributes->
get(PlatformRequest::ATTRIBUTE_HTTP_CACHE
);
if (!
$cache) {