根据指定的cookie名获取cookie
@param  string $name                                                       cookie的名字
@return string cookie的值，如果有加密返回的是解密后的值
554097
public function getCookie($name = null)
    {
        $cookie  = $_COOKIE;
        $encrypt = $this->vitex->getConfig('cookies.encrypt');
        if ($encrypt) {
            $secret_key = $this->vitex->getConfig('cookies.secret_key');
            foreach ($cookie as &$c) {
                try {
                    $c = Utils::decrypt($c, $secret_key);
                } catch(Exception $e){}
            }
        }
        if ($name === null) {
            return $cookie;
        }
        return isset($cookie[$name]) ? $cookie[$name] : '';
    }
544962
public Cookie getCookieObject(String name) {
		Cookie[] cookies = request.getCookies();
		if (cookies != null)
			for (Cookie cookie : cookies)
				if (cookie.getName().equals(name))
					return cookie;
		return null;
	}
797664
public function cookie($name = '', $xss_clean = FALSE, $prefix='') {
		$cfg = Cfg::get('cookie');
		if ($prefix == '' and $cfg['prefix'] != '') {
			$prefix = $cfg['prefix'];
		}
		return $_COOKIE[$prefix.$name];
	}
990680
public function getRaw(string $name): array
    {
        if (strtolower($name) === 'cache-control') {
            return $this->getCacheControlDirectives();
        }

        if (strtolower($name) === 'set-cookie') {
            $cookies = $this->fields['Set-Cookie'] ?? [];
            foreach ($this->cookies as $cookie) {
                $cookies[] = (string)$cookie;
            }

            return $cookies;
        }
        if (!isset($this->fields[$name])) {
            return [];
        }

        return $this->fields[$name];
    }
331692
public static Cookie getCookie(final String name)
	{
		return ((WebRequest)RequestCycle.get().getRequest()).getCookie(name);
	}
424175
public static function CreateCookieName ($name = self::DEFAULT_CONNECTION_NAME) {
		$options = static::GetAuthCookieOptions($name);
		$cookie_save_dir	= $options['cookie_save_dir'];
		$cookie_name_prefix	= $options['cookie_name_prefix'];
		$cookie_name_safix	= $options['cookie_name_safix'];

		clearstatcache();
		for ($i = 0;$i < 100;$i++) {
			$cookie_name = sprintf('%s%s%s', $cookie_name_prefix, Hash::HmacString(rand(1, $i.microtime(true)).$cookie_name_prefix, rand(1, microtime(true)).$cookie_name_safix), $cookie_name_safix);
			if (!is_file(static::CreateCookieSavePath($cookie_name))) {
				return $cookie_name;
			}
		}

		return null;
	}
1307569
public function removeCookie($name)
	{
		$cookie = new SetCookieHeader($name, '');
		$cookie->setExpires(1337);
		
		$this->addHeader($cookie);
		
		return $this;
	}
1073391
public function delete( $name ) {
		unset( $this->cookie[ $name ] ); // Input var okay.
		return $this->set( $name, null, time() - 15 * 60 );
	}
1245948
public function setName($name)
    {
        //Check for invalid cookie name (from PHP source code)
        if (preg_match("/[=,; \t\r\n\013\014]/", $name)) {
            throw new InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name));
        }

        //Check for empty cookie name
        if (empty($name)) {
            throw new InvalidArgumentException('The cookie name cannot be empty.');
        }

        $this->_name = $name;
        return $this;
    }
1252782
public String getCookie(String name) {
		Cookie c = requestCookies.get().get(name);
		return c == null ? null : c.getValue();
	}
1288451
public function name($name = null)
    {
        if ($name !== null) {
            if (preg_match("/[=,; \t\r\n\013\014]/", $name)) {
                throw new \InvalidArgumentException(sprintf('Cookie name "%s" contains invalid characters', $name));
            }

            if (empty($name)) {
                throw new \InvalidArgumentException('Cookie name cannot be empty');
            }

            $this->name = $name;
        }

        return $this->name;
    }
512128
public function getForeignKey(string $name = null)
    {
        // 构造 查询语句
        $sql = $this->db->getCreate($name ? $name : $this->tableName);
        $result = $this->query($sql);

        // 分析结果
        $statement = $result[0]['Create Table'];
        $matched = preg_match_all('/CONSTRAINT\s\S*\sFOREIGN\sKEY\s\(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)/i', $statement, $matches, PREG_SET_ORDER);
        if (!$matched) {
            return false;
        }

        // 如果有多个
        $fks = [];
        foreach ($matches as $m) {
            $fks[$m[1]] = [
                'table' => $m[2],
                'field' => $m[3]
            ];
        }
        return $fks;
    }
131116
public static function get($name, $options = [])
    {
        $default = isset($options["default"]) ? $options["default"] : null;

        return isset($_COOKIE[$name]) ? $_COOKIE[$name] : $default;
    }
459061
public static function get($name)
    {
        if (self::existe($name)) {
            return $_COOKIE[$name];
        }

        exception(CookieKeyNotFoundException::class, $name);
    }
472745
public function setName(string $name) : self
    {
        // from PHP source code
        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.');
        }

        $this->name = $name;

        return $this;
    }
1093515
public String cookie(String name) {
        Cookie[] cookies = servletRequest.getCookies();
        if (cookies != null) {
            for (Cookie cookie : cookies) {
                if (cookie.getName().equals(name)) {
                    return cookie.getValue();
                }
            }
        }
        return null;
    }
728349
public static Cookie cookie(String name){
        javax.servlet.http.Cookie[] servletCookies = RequestContext.getHttpRequest().getCookies();
        if (servletCookies != null) {
            for (javax.servlet.http.Cookie servletCookie : servletCookies) {
                if (servletCookie.getName().equals(name)) {
                    return Cookie.fromServletCookie(servletCookie);
                }
            }
        }
        return null;
    }