Add a cookie to the response.

@see $this->create_cookie()

@param  Cookie|mixed $cookie The Cookie instance or cookie name.
@return $this
188971
public function with_cookie( $cookie ) {
		if ( is_string( $cookie ) ) {
			$cookie = call_user_func_array( [ $this, 'create_cookie' ], func_get_args() );
		}

		$this->headers->setCookie( $cookie );

		return $this;
	}
580226
public function setDomain(?string $domain) : Cookie
    {
        if ($domain !== null) {
            $domain = (string) $domain;
        }

        $this->domain = $domain;

        return $this;
    }
1049401
public function setCookies(array $cookies) : Request
    {
        $query = http_build_query($cookies);
        parse_str($query, $this->cookies);

        if ($cookies) {
            $cookie = str_replace('&', '; ', $query);
            $this->setHeader('Cookie', $cookie);
        } else {
            $this->removeHeader('Cookie');
        }

        return $this;
    }
1124693
public HttpMessage cookie(final Cookie cookie) {
        this.cookies.put(cookie.getName(), cookie);

        setHeader(
                HttpMessageHeaders.HTTP_COOKIE_PREFIX + cookie.getName(),
                cookieConverter.getCookieString(cookie));

        return this;
    }
451778
public function has($cookie)
    {
        if (isset(static::$cookies[$cookie]) || $cookie == $this->name) {
            return true;
        }

        return false;
    }
947319
public function has($cookie) {

        if ( empty($cookie) ) throw new CookieException("Invalid cookie object or name");

        $name = ($cookie instanceof CookieInterface) ? $cookie->getName() : $cookie;

        return array_key_exists($name, $this->cookies);

    }
13934
public function addCookie(KHttpCookie $cookie)
    {
        $this->_cookies[$cookie->domain][(string) $cookie->path][$cookie->name] = $cookie;
    }
417553
public function addCookieObject(Cookie $cookie)
    {
        $name = $cookie->getName();
        $isNew = true;
        foreach ($this->cookies as $index => $value) {
            if ($value->getName() === $name) {
                $this->cookies[$index] = $cookie;
                $isNew = false;
            }
        }
        if ($isNew) {
            $index = array_search($name, $this->clearedCookies, true);
            if ($index !== false) {
                unset($this->clearedCookies[$index]);
                $this->clearedCookies = array_values($this->clearedCookies);
            }
            $this->cookies[] = $cookie;
        }

        return $this;
    }
947346
public function sendCookies()
    {
        foreach ($this->cookies as $name => $c) {
            setcookie(
                $name,
                $c['value'], // encryptValue
                $c['expire'],
                $c['path'],
                $c['domain'],
                $c['secure'],
                $c['httpOnly']
            );
        }

        return $this;
    }
794856
public function removeAdditionalCookie($cookie)
    {
        $additionalCookie = $this->_getData('_additional_cookie');
        if (!$additionalCookie || !is_array($additionalCookie)) {
            return $this;
        }

        if (isset($additionalCookie[$cookie])) {
            unset($additionalCookie[$cookie]);
        }

        $this->setData('_additional_cookie', $additionalCookie);
        return $this;
    }
655502
def set_cookie(self, cookie=None):
        """"""
        if cookie:
            self._cookie = cookie.encode()
        else:
            self._cookie = None
148333
public function applyCookies($cookies)
    {
        $values = [];
        foreach ($cookies as $cookie) {
            if ($cookie->matches($this->url())) {
                $values[$cookie->path()] = $cookie->name() . '=' . $cookie->value();
            }
        }

        $keys = array_map('strlen', array_keys($values));
        array_multisort($keys, SORT_DESC, $values);
        $headers = $this->headers();
        if ($values) {
            $headers['Cookie'] = implode('; ', $values);
        } else {
            unset($headers['Cookie']);
        }
        return $this;
    }
338454
private function removeCookieIfEmpty(Cookie $cookie)
    {
        $cookieValue = $cookie->getValue();
        if ($cookieValue === null || $cookieValue === '') {
            $this->remove($cookie->getDomain(), $cookie->getPath(), $cookie->getName());
        }
    }
911371
public function track($cookie)
    {
        if ( ! $cookie) {
            $this->cookie()->queue(
                $this->cookie()->make($this->getConfig('cookie.name'), $cookie = (string) Uuid::uuid4())
            );
        }

        return $this->getModel()
                    ->newQuery()
                    ->firstOrCreate(['uuid' => $cookie])
                    ->getKey();
    }
692743
def add_cookie(self, key, value, **attrs):
        '''
        
        '''
        if attrs:
            c = Morsel()
            c.set(key, value, **attrs)
            self.cookies[key] = c
        else:
            self.cookies[key] = value
1077485
public function withCookie(Cookie $cookie)
    {
        $clone = clone $this;
        $clone->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;
        return $clone;
    }
1089638
public function set(\BearFramework\App\Response\Cookie $cookie): self
    {
        $this->data[$cookie->name] = $cookie;
        return $this;
    }