$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);
});
} public function removeAllCookies(Request
$request, Response
$response): void
{ $technicallyRequiredCookies =
$this->
getTechnicallyRequiredCookies();
$this->
removeCookies($request,
$response,
static function Dstring
$cookieKey) use ($technicallyRequiredCookies) {