function ResponseHeaderBag::removeCookie
Removes a cookie from the array, but does not unset it in the browser.
File
-
vendor/
symfony/ http-foundation/ ResponseHeaderBag.php, line 169
Class
- ResponseHeaderBag
- ResponseHeaderBag is a container for Response HTTP headers.
Namespace
Symfony\Component\HttpFoundationCode
public function removeCookie(string $name, ?string $path = '/', ?string $domain = null) : void {
$path ??= '/';
unset($this->cookies[$domain][$path][$name]);
if (empty($this->cookies[$domain][$path])) {
unset($this->cookies[$domain][$path]);
if (empty($this->cookies[$domain])) {
unset($this->cookies[$domain]);
}
}
if (!$this->cookies) {
unset($this->headerNames['set-cookie']);
}
}