public function deleteCookie(string $name = '', string $domain = '', string $path = '/', string $prefix = '')
	{
		if (empty($name))
		{
			return $this;
		}

		if ($prefix === '' && $this->cookiePrefix !== '')
		{
			$prefix = $this->cookiePrefix;
		}

		$name = $prefix . $name;

		foreach ($this->cookies as &$cookie)
		{
			if ($cookie['name'] === $name)
			{
				if (! empty($domain) && $cookie['domain'] !== $domain)
				{
					continue;
				}
				if (! empty($path) && $cookie['path'] !== $path)
				{
					continue;
				}
				$cookie['value']   = '';
				$cookie['expires'] = '';

				break;
			}
		}

		return $this;
	}
public function deleteCookie(string $name = '', string $domain = '', string $path = '/', string $prefix = '')
	{
		if (empty($name))
		{
			return $this;
		}

		if ($prefix === '' && $this->cookiePrefix !== '')
		{
			$prefix = $this->cookiePrefix;
		}

		$name = $prefix . $name;

		foreach ($this->cookies as &$cookie)
		{
			if ($cookie['name'] === $name)
			{
				if (! empty($domain) && $cookie['domain'] !== $domain)
				{
					continue;
				}
				if (! empty($path) && $cookie['path'] !== $path)
				{
					continue;
				}
				$cookie['value']   = '';
				$cookie['expires'] = '';

				break;
			}
		}

		return $this;
	}
public function deleteCookie ( string $ name = '' , string $ domain = '' , string $ path = '/' , string $ prefix = '' ) { if ( empty ( $ name ) ) { return $ this ; } if ( $ prefix === '' && $ this -> cookiePrefix !== '' ) { $ prefix = $ this -> cookiePrefix ; } $ name = $ prefix . $ name ; foreach ( $ this -> cookies as & $ cookie ) { if ( $ cookie [ 'name' ] === $ name ) { if ( ! empty ( $ domain ) && $ cookie [ 'domain' ] !== $ domain ) { continue ; } if ( ! empty ( $ path ) && $ cookie [ 'path' ] !== $ path ) { continue ; } $ cookie [ 'value' ] = '' ; $ cookie [ 'expires' ] = '' ; break ; } } return $ this ; }
Sets a cookie to be deleted when the response is sent.

@param string $name
@param string $domain
@param string $path
@param string $prefix

@return $this
Sets a cookie to be deleted when the response is sent .