Sets a request cookie by name.

@since 1.0.0

@param string                 $name          The name.
@param RequestCookieInterface $requestCookie The request cookie.
333891
public function set(string $name, RequestCookieInterface $requestCookie): void
    {
        $this->requestCookies[$name] = $requestCookie;
    }
1308887
public final static void addCookie(String name, String value) {
		getServletResponse().addCookie(new Cookie(name, value));
	}
1340685
public function setHeader(string $name, $value)
    {
        parent::setHeader($name, $value);

        if (\stripos($name, "set-cookie") === 0) {
            $this->setCookiesFromHeaders();
        }
    }
119552
public function addCookie($name, $value = null)
    {
        if (is_array($name)) {
            $this->cookies = $name + $this->cookies;
        } else {
            $this->cookies[$name] = $value;
        }
    }
937214
protected function setCookie($name, $id)
    {
        $expire = $this->cookie_lifetime ? time() + (int)$this->cookie_lifetime : 0;
        return setcookie(
            $name,
            $id,
            $expire,
            $this->cookie_path,
            $this->cookie_domain,
            (bool)$this->cookie_secure,
            (bool)$this->cookie_httponly
        );
    }
65148
protected function deleteCookie($name)
	{
		// Remove the cookie
		unset($_COOKIE[$name]);

		// Nullify the cookie and make it expire
		return setcookie($name, null, -86400, $this->config['cookie_path'], $this->config['cookie_domain'], $this->config['cookie_secure'], $this->config['cookie_http_only']);
	}
1158041
public static function setcookie($name, $value, $exp = 0)
    {
        if (headers_sent()) {
            return;
        }

        $cookie = session_get_cookie_params();
        $secure = $cookie['secure'] || self::https_check();

        setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'], $secure, true);
    }
266971
protected function validateName($name)
    {
        if (preg_match("/[=,;\t\r\n\013\014]/", $name)) {
            throw new InvalidArgumentException(
                sprintf('The cookie name `%s` contains invalid characters.', $name)
            );
        }

        if (empty($name)) {
            throw new InvalidArgumentException('The cookie name cannot be empty.');
        }
    }
1252782
public String getCookie(String name) {
		Cookie c = requestCookies.get().get(name);
		return c == null ? null : c.getValue();
	}
1134304
protected function setCookie($name, $value = null, $expire = null, $domainPath = null, $https = null, $httpOnly = null)
    {
        return setcookie($name, $value, $expire, $domainPath, $https, $httpOnly);
    }
1070753
public function setRequest(\WowApi\Request\RequestInterface $request)
    {
        $request->setClient($this);
        $this->request = $request;
    }
1216781
protected function setCookie($name, $value = '') {
    // Don't set cookies if this service is used via drush.
    if (PHP_SAPI === 'cli') {
      return;
    }

    if (isset(\Drupal::request()->cookies)) {
      \Drupal::request()->cookies->set("Drupal_visitor_{$name}", $value);
    }

    user_cookie_save([
      $name => $value,
    ]);
  }
64318
public function set_cookie($name, $value = null)
	{
		is_null($value)
			? $this->connection()->__setCookie($name)
			: $this->connection()->__setCookie($name, $value);
	}
377878
public static function setCookie(
        ResponseInterface $response,
        /*# string */ $name,
        /*# string */ $value = null,
        /*# int */ $ttl = null,
        /*# string */ $path = null,
        /*# string */ $domain = null,
        /*# bool */ $secure = false,
        /*# bool */ $httponly = true
    )/*# : ResponseInterface */ {
        $cookie = urlencode($name) . '=' . urlencode($value);

        self::addExpire($cookie, $ttl);

        self::addDomain($cookie, $domain);

        self::addPath($cookie, $path);

        self::addSecure($cookie, $secure);

        self::addHttpOnly($cookie, $httponly);

        return $response->withAddedHeader('Set-Cookie', $cookie);
    }
490693
public function setCookie($name, $value = null) {
    if ($value === null) {
      $this->browser->removeCookie($name);
    }
    //TODO: set the cookie with domain, not with url, meaning www.aaa.com or .aaa.com
    if ($value !== null) {
      $urlData = parse_url($this->getCurrentUrl());
      $cookie = array("name" => $name, "value" => $value, "domain" => $urlData["host"]);
      $this->browser->setCookie($cookie);
    }
  }
639531
public function get(string $name): ?ResponseCookieInterface
    {
        if (!isset($this->responseCookies[$name])) {
            return null;
        }

        return $this->responseCookies[$name];
    }
1211100
protected function addCookieIntOption($name, $value)
    {
        $value = trim($value);
        if ($value !== null && $value !== '' && is_numeric($value)) {
            $this->addOption('cookie', $name, (int)$value);
        }
    }