Read cookie data from the request's cookie data.

@param string $key The key you want to read.
@return null|string Either the cookie value, or null if the value doesn't exist.
@deprecated 3.4.0 Use getCookie() instead.
521
public function cookie($key)
    {
        deprecationWarning(
            'ServerRequest::cookie() is deprecated. ' .
            'Use getCookie() instead.'
        );

        if (isset($this->cookies[$key])) {
            return $this->cookies[$key];
        }

        return null;
    }
1331989
public function getCookieItem($key)
    {
        return isset($this->cookie[$key]) ? $this->cookie[$key] : null;
    }
919159
public function get($key)
    {
        if (!$key || !isset($this->sessionData[$key])) {
            return null;
        }

        return $this->sessionData[$key];
    }
1294236
public static function getValue(string $key)
    {
        $key = \mb_strtolower($key);
        if(isset(self::$_data[$key])) {
            return self::$_data[$key];
        }
        return null;
    }
677584
public function cookies($key = null)
    {
        if (!isset($this->env['slim.request.cookie_hash'])) {
            $cookieHeader = isset($this->env['COOKIE']) ? $this->env['COOKIE'] : '';
            $this->env['slim.request.cookie_hash'] = Util::parseCookieHeader($cookieHeader);
        }
        if ($key) {
            if (isset($this->env['slim.request.cookie_hash'][$key])) {
                return $this->env['slim.request.cookie_hash'][$key];
            } else {
                return null;
            }
        } else {
            return $this->env['slim.request.cookie_hash'];
        }
    }
740630
protected function getSessionData($key)
    {
        if ($key === 'id') {
            return session_id();
        }

        return isset($_SESSION[$key]) ? $_SESSION[$key] : null;
    }
948351
public function get($key)
    {
        $value = $this->connection()->get($this->prefix.$key);

        return ! is_null($value) ? $this->unserialize($value) : null;
    }
571829
public function get($key)
    {
        Assertion::string($key);

        if (!\array_key_exists($key, $this->cookies)) {
            return;
        }

        return $this->cookies[$key];
    }
167557
public static function get($key) {
        return self::has($key) ? self::decode($_COOKIE[$key]) : NULL;
    }
675105
public function getData($key = ''){

        $key = $this->normalizeKeyName($key);

        if( $key === '' ){
            return $this->_data;
        }

        return isset($this->_data[$key]) ? $this->_data[$key] : NULL;
    }
422863
public function get($key)
    {
        if (empty($this->data[$key]) === true) {
            return null;
        }

        return $this->data[$key];
    }
112875
public function getSessionData( $key ) {
		self::ensureSession();
		if ( !isset( $_SESSION[ $key ] ) ) {
			return null;
		}
		return $_SESSION[$key];
	}
136170
public static function get(string $key)
    {
        $encodedValue = @file_get_contents(self::determineDabaseFilePathFor($key));
        if ($encodedValue === false) {
            return null;
        }

        return Json::decode($encodedValue);
    }
23199
protected function retrieve($key)
    {
        $value = dba_fetch($key, $this->dba);

        if (false === $value) {
            return null;
        }

        // compare the timestamp to the current time when we read the value.
        if (time() >= substr($value, 0, 10)) {
            $this->forget($key);
            return null;
        }

        return unserialize(substr($value, 10));
    }
150559
public function getCookie($key, $default = null) {
		return isset($this->cookie[$key]) ? $this->cookie[$key] : $default;
	}
379585
private function loadFromCache($key)
    {
        $encoded = (string) $this
            ->cache
            ->fetch($key);

        try {
            return is_string($encoded)
                ? $this
                    ->encoder
                    ->decode($encoded)
                : null;
        } catch (Exception $e) {
            // Silent pass
        }

        return null;
    }
1094707
public function read(Request $request)
    {
        if (!$request->cookies->has($this->cookieSettings->getName())) {
            return null;
        }

        return $this->createCookieWithValue(
            $request->cookies->get($this->cookieSettings->getName())
        );
    }