class CookieRemoveHandler extends CookieHandler
implements CookieRemoveHandlerInterface
{ public const COOKIE_CONFIG_KEY = 'x-shopware-cookie-config';
public const COOKIE_GROUP_COLLECTION_KEY = 'x-shopware-cookie-group-collection';
public function removeCookiesFromPreferences(Request
$request, Response
$response): void
{ $preferences =
$request->cookies->
get(self::PREFERENCES_COOKIE_NAME
);
if ($preferences === null
) { $this->
removeAllCookies($request,
$response);
return;
} $preferences =
json_decode($preferences, true
);
$preferences =
$this->
removeInvalidCookiesFromPreferences($request,
$response,
$preferences);
$this->
removeCookies($request,
$response,
function Dstring
$cookieName) use ($preferences) { return $this->
isCookieAllowedByPreferences($cookieName,
$preferences);
});
}