@param Cookie $cookie

@return Cookie
327860
private function encodeCookie(Cookie $cookie): Cookie
    {
        if ($this->config->cookieProtectionMethod() == HttpConfig::COOKIE_ENCRYPT) {
            $encrypter = $this->encryption->getEncrypter();

            return $cookie->withValue($encrypter->encrypt($cookie->getValue()));
        }

        //VALUE.HMAC
        return $cookie->withValue($cookie->getValue() . $this->hmacSign($cookie->getValue()));
    }
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();
    }
887436
public function cookies(array $cookies = null): HttpRequest
    {
        if ($cookies === null) {
            $cookies = $_COOKIE;
        }
        foreach ($cookies as $name => $value) {
            $this->cookie($name, $value);
        }

        return $this;
    }
500329
protected function decryptCookie($cookie)
    {
        if (is_array($cookie)) {
            return $this->decryptArray($cookie);
        } else {
            try {
                return $this->encrypter->decrypt(urldecode($cookie));
            } catch (Exception $e) {
                return $this->encrypter->decrypt($cookie);
            }
        }
    }
31010
public function setCookie(ResponseCookie $cookie)
    {
        $this->cookies[$cookie->getName()] = $cookie;
        $this->setHeadersFromCookies();
    }
556814
public function cookie(string $key, $default = null)
  {
    return $this->cookie->has($key) ? $this->cookie->get($key) : $default;
  }
300583
public function cookie(array $cookie) {

        $cookies = '';

        foreach($cookie as $k => $v)

            $cookies .= $k . '=' . $v . ';';

        curl_setopt(self::$handle, CURLOPT_COOKIE, $cookies);

        return $this;
    }
980901
def set_cookie(self, cookie):
        """"""
        c = self._cookies
        self._cookies_lock.acquire()
        try:
            if cookie.domain not in c: c[cookie.domain] = {}
            c2 = c[cookie.domain]
            if cookie.path not in c2: c2[cookie.path] = {}
            c3 = c2[cookie.path]
            c3[cookie.name] = cookie
        finally:
            self._cookies_lock.release()
308209
public function setCookies($cookies)
    {
        if (!$cookies instanceof CookieBag) {
            $cookies = new CookieBag(CookieBag::normalize($cookies));
        }

        $this->_cookies = $cookies;
    }
738509
protected function decryptCookie($name, $cookie)
    {
        return is_array($cookie)
                        ? $this->decryptArray($cookie)
                        : $this->encrypter->decrypt($cookie, static::serialized($name));
    }
799412
public function addCookie(Cookie $cookie) : self
    {
        if (isset($this->cookies[$cookie->getName()])) {
            throw new \InvalidArgumentException(sprintf("Cookie '%s' is already set", $cookie->getName()));
        }

        $this->cookies[$cookie->getName()] = $cookie;

        return $this;
    }
165968
public function setCookie(CookieJar $cookie)
    {
        return $this->getCache()->save($this->getCacheKey(), $cookie, Config::get('cache.expire', 100));
    }
1341537
public function fetchCookies($request, $response)
    {
        foreach ($response->cookies($request) as $cookie) {
            $this->add($cookie);
        }
        return $this;
    }
850154
public function cookie($cookie = null) {
        if ($cookie === null) {
            $this->cookies = [];
        } else {
            $this->cookies[] = $cookie;
        }

        return $this;
    }
456596
public function get($cookie)
    {
        if (!$this->has($cookie)) {
            if ($this->getRequest()) {
                return $this->getRequest()->getCookie($cookie);
            }
            
            return null;
        }
        
        return $this->_cookies[$cookie]['value'];
    }
64701
public function addCookie(CookieInterface $cookie)
    {

        // check if this cookie has already been set
        if ($this->hasCookie($name = $cookie->getName())) {
            // then check if we've already one cookie header available
            if (is_array($cookieValue = $this->getCookie($name))) {
                $cookieValue[] = $cookie;
            } else {
                $cookieValue = array($cookieValue, $cookie);
            }

            // add the cookie array
            $this->cookies[$name] = $cookieValue;

        } else {
            // when add it the first time, simply add it
            $this->cookies[$name] = $cookie;
        }
    }
639059
public function withCookieCollection(CookieCollection $cookies)
    {
        $new = clone $this;
        $values = [];
        foreach ($cookies as $cookie) {
            $values[$cookie->getName()] = $cookie->getValue();
        }
        $new->cookies = $values;

        return $new;
    }