Returns a Cookie.

@return Cookie|null returns cookie or null if cookie was not found
5383
public function get($name)
    {
        $cookies = $this->getAll();

        foreach ($cookies as $cookie) {
            if ($cookie->getName() == $name) {
                return $cookie;
            }
        }

        return null;
    }
7619
public function getCSRFCookie()
	{
		$cookie = $this->_browserInterface->getCookie($this->_csrf_cookiename);
		if ( !$cookie )
			throw new SecureRequestHelper\CSRFException('CSRF cookie has not been initialized');
		
		return $cookie;
	}
58371
public function get($key = null)
    {
        //argument 1 must be a string or null
        Argument::i()->test(1, 'string', 'null');

        if (is_null($key)) {
            return $_COOKIE;
        }

        if (isset($_COOKIE[$key])) {
            return $_COOKIE[$key];
        }

        return null;
    }
404959
public function getCookie($name = null, $default = '')
    {
        $context = $this->_context;

        if ($name === null) {
            return $context->_COOKIE;
        } elseif (isset($context->_COOKIE[$name])) {
            return $context->_COOKIE[$name];
        } else {
            return $default;
        }
    }
1057191
public function get($name) {
        if (isset($this->_deleted_cookies[$name])) {
            return null;
        }

        if (\array_key_exists($name, $this->_cookies)) {
            return $this->_cookies[$name];
        }

        $value = isset($_COOKIE[$name]) ? $_COOKIE[$name] : null;
        $this->_cookies[$name] = $value;

        return $value;
    }
456596
public function get($cookie)
    {
        if (!$this->has($cookie)) {
            if ($this->getRequest()) {
                return $this->getRequest()->getCookie($cookie);
            }
            
            return null;
        }
        
        return $this->_cookies[$cookie]['value'];
    }
1195145
@Override
    public Cookie[] getCookies() {
        List<HttpCookie> cookies = this.request.getCookies();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getCookies: " + cookies.size());
        }
        if (cookies.isEmpty()) {
            return null;
        }
        Cookie[] output = new Cookie[cookies.size()];
        int i = 0;
        for (HttpCookie cookie : cookies) {
            output[i++] = new Cookie(cookie.getName(), cookie.getValue());
        }
        return output;
    }
1250601
public function value()
    {
        if (strtolower($this->name()) === 'set-cookie') {
            return join("\r\n" . $this->name() . ': ', $this->data());
        } else {
            return join(', ', $this->_data);
        }
    }
1019245
public function getCookie(string $name) : ?string
    {
        return (($this->cookies->has($name) === true) ? $this->cookies->get($name)->getValue() : null);
    }
987074
public function getCookie($name)
    {
        $this->buildCookieCollection();
        if (!$this->cookies->has($name)) {
            return null;
        }

        return $this->cookies->get($name)->getValue();
    }
291122
public function getResponseCookies()
    {
        if (!is_array($this->responseCookies)) {
            $cookies = $this->getResponseHeader('SET-COOKIE', false);
            $this->responseCookies = array();
            foreach ($cookies as $cookie) {
                $this->responseCookies += $this->parseCookie($cookie);
            }
        }
        return $this->responseCookies;
    }
36116
public function cookies($key = null)
    {
        if ($key) {
            return $this->cookies->get($key);
        }

        return $this->cookies;
       
    }
341972
public function getCookie(string $name = null)
    {
        if ($name === null) {
            return $this->cookies;
        }

        return $this->resolvePath($this->cookies, $name);
    }
771815
public function getCookie($name)
    {
        if (!$this->_cookies->has($name)) {
            return null;
        }

        $cookie = $this->_cookies->get($name);

        return $this->convertCookieToArray($cookie);
    }
1084239
function getCookieParams()
    {
        if ($this->_cookie === null) {
            $params = PhpServer::_($this->httpMessage)->getCookie();
            $this->_cookie = \Poirot\Std\cast($params)->toArray();
        }

        return $this->_cookie;
    }
666952
public function getCookie(): ?Factory
    {
        if (!$this->hasCookie()) {
            $this->setCookie($this->getDefaultCookie());
        }
        return $this->cookie;
    }
280954
public final function cookies(array $cookies = null): array
    {
        return ($cookies == null) ? $this->getCookies() : $this->getCookies($cookies);
    }