/*
Delete a custom cookie or block a global cookie from being used.

name - The name of the cookie to delete
domain - The website the cookie belongs to

This function returns true if the cookie was successfully set.
17994
public function DeleteCookie($name, $domain)
	{
		$sig =	$this->encode($this->applicationSecret."|".$name."|".$domain."|1");

		$qs = "key=" .urlencode($this->applicationKey)."&domain=".urlencode($domain)."&name=".urlencode($name)."&delete=1&sig=".$sig;

		return $this->isSuccessful($this->Get($this->getRootUrl(false) . "setcookie.ashx?" . $qs));
	}
370329
public function deleteCookie($name, $path = null, $domain = null, $secure = false, $httpOnly = true)
    {
        $context = $this->_context;

        $context->cookies[$name] = [
            'name' => $name,
            'value' => 'deleted',
            'expire' => 1,
            'path' => $path,
            'domain' => $domain,
            'secure' => $secure,
            'httpOnly' => $httpOnly
        ];

        $globals = $this->request->getGlobals();

        unset($globals->_COOKIE[$name]);

        return $this;
    }
1141735
def remove_cookie(domain, name)
      cm = @webclient.getCookieManager
      cookie = cm.getCookies.find { |c| c.getDomain == domain && c.getName == name }

      if cookie.nil?
        raise CookieNotFoundError, "no cookie with domain #{domain.inspect} and name #{name.inspect}"
      end

      cm.removeCookie(cookie)
    end
528074
protected function deleteCookie($name)
    {
        $nameEscaped = json_encode($name);

        $js = <<<JS
(function(){
    var path = location.pathname;

    do {
        document.cookie = {$nameEscaped} + '=; path=' + path + '; expires=Thu, 01 Jan 1970 00:00:00 GMT';
        path = path.replace(/.$/, '');
    } while (path);
})()
JS;

        try {
            $this->executeScript($js);
        } catch (\Exception $e) {
            // ignore error
        }
    }
721958
function(name) {
    var regexp, idx,
      length = this.extraHeaders.length;

    if (this.headers[Utils.headerize(name)]) {
      return true;
    } else {
      regexp = new RegExp('^\\s*'+ name +'\\s*:','i');
      for (idx=0; idx<length; idx++) {
        if (regexp.test(this.extraHeaders[idx])) {
          return true;
        }
      }
    }

    return false;
  }
1346021
public void deleteCookie(Cookie cookie) {
        cookies.remove(cookie.name());
        deletePersistedCookie(cookie.name());
    }
1085272
public function clear($name)
    {
        if (!in_array($name, $this->clearedCookies, true)) {
            $this->clearedCookies[] = $name;
            foreach ($this->cookies as $index => $value) {
                if ($value->getName() === $name) {
                    unset($this->cookies[$index]);
                }
            }
            $this->cookies = array_values($this->cookies);
        }
    }
658111
protected function getCookieMatchingName($name)
    {
        if ($this->configCookiesDisabled) {
            return false;
        }
        if (!is_array($_COOKIE)) {
            return false;
        }
        $name = $this->getCookieName($name);

        // Piwik cookie names use dots separators in piwik.js,
        // but PHP Replaces . with _ http://www.php.net/manual/en/language.variables.predefined.php#72571
        $name = str_replace('.', '_', $name);
        foreach ($_COOKIE as $cookieName => $cookieValue) {
            if (strpos($cookieName, $name) !== false) {
                return $cookieValue;
            }
        }

        return false;
    }
632265
public function clear($domain = null, $path = null, $name = null)
    {
        if (!$domain) {
            $this->_data = [];
            return;
        } elseif (!$path) {
            $this->_data = array_filter(
                $this->_data,
                function ($cookie) use ($path, $domain) {
                    return !$cookie->matchesDomain($domain);
                }
            );
        } elseif (!$name) {
            $this->_data = array_filter(
                $this->_data,
                function ($cookie) use ($path, $domain) {
                    return !($cookie->matchesPath($path) &&
                        $cookie->matchesDomain($domain));
                }
            );
        } else {
            $this->_data = array_filter(
                $this->_data,
                function ($cookie) use ($path, $domain, $name) {
                    return !($cookie->name() == $name &&
                        $cookie->matchesPath($path) &&
                        $cookie->matchesDomain($domain));
                }
            );
        }
        return $this;
    }
631153
public static function DeleteSessionCookie () {
		if (static::UseCookie()) {
			$cookie_params = static::CookieParams();
			setcookie(
				static::Name(),
				'',
				time() - 42000,
				$cookie_params['path'],
				$cookie_params['domain'],
				$cookie_params['secure'],
				$cookie_params['httponly']
			);
		}
	}
976000
function(name) {
      if (typeOf(name) === "array") {
        for (var i = name.length; i--;) {
          this.off(name[i]);
        }
      } else {
        if (this._rules[name]) {
          delete this._rules[name];
        }
      }
      return this;
    }
1041146
public static void removeCookie(
		HttpServletRequest request,
		HttpServletResponse response,
		String cookieName,
		boolean secure,
		boolean contextOnlyPath
	) {
		addCookie(request, response, cookieName, "Removed", null, 0, secure, contextOnlyPath);
	}
176298
public function drop_cookie($name) {
		$retval = FALSE;
		if(isset($_COOKIE[$name])) {
			setcookie($name, $_COOKIE[$name], time() -10000, '/');
			unset($_COOKIE[$name]);
			$retval = TRUE;
		}
		return($retval);
	}
606164
@Sensitive
    public static void clearCookie(HttpServletRequest req, HttpServletResponse res, String cookieName, Cookie[] cookies) {
        Cookie existing = getCookie(cookies, cookieName);
        if (existing != null) {
            Cookie c = new Cookie(cookieName, "");

            String path = existing.getPath();
            if (path == null)
                path = "/";
            c.setPath(path);

            c.setMaxAge(0);

            //c.setHttpOnly(existing.isHttpOnly());
            c.setSecure(existing.getSecure());

            res.addCookie(c);
        }

    }
1153720
function(_name){
            var _cookie = document.cookie,
                _search = '\\b'+_name+'=',
                _index1 = _cookie.search(_search);
            if (_index1<0) return '';
            _index1 += _search.length-2;
            var _index2 = _cookie.indexOf(';',_index1);
            if (_index2<0) _index2 = _cookie.length;
            return _cookie.substring(_index1,_index2)||'';
        }
1179977
public static function delete($name,$path = '', $domain = '', $secure = '')
	{
		if(!self::$isInit)
		{
			self::init();
		}
		if(!is_array($name))
		{
			$name = array($name);
		}
		foreach ($name as $val)
		{
			setcookie($val,null,0,'' == $path ? self::$path : $path, '' == $domain ? self::$domain : $domain, '' == $secure ? self::$secure : $secure);
		}
		return true;
	}
1093515
public String cookie(String name) {
        Cookie[] cookies = servletRequest.getCookies();
        if (cookies != null) {
            for (Cookie cookie : cookies) {
                if (cookie.getName().equals(name)) {
                    return cookie.getValue();
                }
            }
        }
        return null;
    }