判断Cookie数据
@param string $name cookie名称
@param string|null $prefix cookie前缀
@return bool
480906
public function has($name, $prefix = null) {
        $prefix = !is_null($prefix) ? $prefix : $this->config['prefix'];
        $name = $prefix . $name;
        return isset($_COOKIE[$name]);
    }
1221201
public function containsCookie(string $name, string $value = null): bool
    {
        if (isset($this->cookies[$name])) {
            if (null !== $value) {
                return $this->cookies[$name]->value() === $value;
            }

            return true;
        }

        return false;
    }
177821
public function name($name)
    {
        if (is_null($name)) {
            throw new \InvalidCookieException('Cookie name cannot be null');

            return false;
        }

        $this->name = (string) $this->security->sanitize($name);

        return $this;
    }
668039
static public function getCookie($name=null)
    {
        $prefix = $this->options['group'] ? $this->options['group'] . '_' : 'WS_';
        if ($name) $name =  $prefix . $name;
        return HttpHelper::getCookie($name);
    }
779417
public function hasCookie($name)
    {
        if (!$this->request) {
            return $this->getRequest()->hasCookie($name);
        }
        return parent::hasCookie($name);
    }
831770
public static function get($name = '')
    {
        !isset(self::$init) && self::init();

        if ('' == $name) {
            return $_COOKIE;
        }
        return isset($_COOKIE[$name]) ? $_COOKIE[$name] : false;
    }
852733
public static Cookie getCookie(String name, Cookie[] cookies) {
        if (Checker.isNotEmpty(cookies)) {
            for (Cookie cookie : cookies) {
                if (name.equals(cookie.getName())) {
                    return cookie;
                }
            }
        }
        return null;
    }
602548
public function cookie( $name = '', $default = null, $filter = '' )
	{
		if( empty( $this->cookie ) ){
			$this->cookie = Cookie::get();
		}
		if( is_array( $name ) ){
			return $this->cookie = array_merge( $this->cookie, $name );
		} elseif( !empty( $name ) ){
			$data = Cookie::has( $name ) ? Cookie::get( $name ) : $default;
		} else{
			$data = $this->cookie;
		}

		// 解析过滤器
		$filter = $this->getFilter( $filter, $default );

		if( is_array( $data ) ){
			array_walk_recursive( $data, [$this, 'filterValue'], $filter );
			reset( $data );
		} else{
			$this->filterValue( $data, $name, $filter );
		}
		return $data;
	}
759184
public function getElement( $name, $prefix = null )
	{
		return $this->hasElement( $name, $prefix )
			? $this->elements[ is_null( $prefix ) ? $name : "$prefix:$name" ]
			: false;
	}
520815
public function getValue($name)
    {
        $cookie = $this->get($name);

        return null === $cookie ? null : $cookie->getValue();
    }
826968
public function cookie(string $name): string {
        if (!isset($this->cookies[$name])) {
            return "";
        }
        return $this->cookies[$name];
    }
741409
public function decrypt($name)
    {
        $name = isset($this->options[ 'prefix' ])
            ? $this->options[ 'prefix' ] . $name
            : $name;

        if ($value = input()->cookie($name)) {
            return $this->crypt->decrypt($value);
        }

        return false;
    }
987074
public function getCookie($name)
    {
        $this->buildCookieCollection();
        if (!$this->cookies->has($name)) {
            return null;
        }

        return $this->cookies->get($name)->getValue();
    }
1319227
public function get($name = '', $prefix = null) {
        $prefix = !is_null($prefix) ? $prefix : $this->prefix;
        if ('' == $name) {
            // 获取全部的session
            $value = $prefix ? (!empty($_SESSION[$prefix]) ? $_SESSION[$prefix] : []) : $_SESSION;
        }
        elseif ($prefix) {
            // 获取session
            if (strpos($name, '.')) {
                list($name1, $name2) = explode('.', $name);
                $value = isset($_SESSION[$prefix][$name1][$name2]) ? $_SESSION[$prefix][$name1][$name2] : null;
            }
            else {
                $value = isset($_SESSION[$prefix][$name]) ? $_SESSION[$prefix][$name] : null;
            }
        }
        else {
            if (strpos($name, '.')) {
                list($name1, $name2) = explode('.', $name);
                $value = isset($_SESSION[$name1][$name2]) ? $_SESSION[$name1][$name2] : null;
            }
            else {
                $value = isset($_SESSION[$name]) ? $_SESSION[$name] : null;
            }
        }
        return $value;
    }
332994
public static function _realName($name,$prefix=null){
		$name = preg_replace('/^'.$prefix.'/','',$name);
		$name = preg_replace('/([A-Z]{1})/','_$1',$name);
		$name = strtolower($name);
		$name = trim($name,'_');
		return $name;
	}
707720
public function getCookie($name, $default = null)
    {
        $result = $default;

        if (isset($_COOKIE[$name])) {
            $result = $_COOKIE[$name];
        }

        return $result;
    }
506456
public function set($name, $value = '', $prefix = null) {
        $prefix = !is_null($prefix) ? $prefix : $this->prefix;
        if (strpos($name, '.')) {
            // 二维数组赋值
            list($name1, $name2) = explode('.', $name);
            if ($prefix) {
                $this->data[$prefix][$name1][$name2] = $value;
            }
            else {
                $this->data[$name1][$name2] = $value;
            }
        }
        elseif ($prefix) {
            $this->data[$prefix][$name] = $value;
        }
        else {
            $this->data[$name] = $value;
        }
        $this->hander->write($this->sessionID,serialize($this->data));
    }