Convert to `Set-Cookie` header
@param  string $name Cookie name
@param  array  $properties Cookie properties
@return string
340297
protected function toHeaderLine(string $name, array $properties): string
    {
        $result = \urlencode($name) . '=' . \urlencode($properties['value']);

        if (isset($properties['domain'])) {
            $result .= '; domain=' . $properties['domain'];
        }

        if (isset($properties['path'])) {
            $result .= '; path=' . $properties['path'];
        }

        if (isset($properties['expires'])) {
            if (\is_string($properties['expires'])) {
                $timestamp = \strtotime($properties['expires']);
            } else {
                $timestamp = (int)$properties['expires'];
            }
            if ($timestamp !== 0) {
                $result .= '; expires=' . \gmdate('D, d-M-Y H:i:s e', $timestamp);
            }
        }

        if (!empty($properties['secure'])) {
            $result .= '; secure';
        }

        if (!empty($properties['hostOnly'])) {
            $result .= '; HostOnly';
        }

        if (!empty($properties['httpOnly'])) {
            $result .= '; HttpOnly';
        }

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

        return $this->resolvePath($this->cookies, $name);
    }
917727
public function get_cookie($name) {
		$retval = NULL;
		if(isset($_COOKIE) && isset($_COOKIE[$name])) {
			$retval = $_COOKIE[$name];
		}
		return($retval);
	}
937214
protected function setCookie($name, $id)
    {
        $expire = $this->cookie_lifetime ? time() + (int)$this->cookie_lifetime : 0;
        return setcookie(
            $name,
            $id,
            $expire,
            $this->cookie_path,
            $this->cookie_domain,
            (bool)$this->cookie_secure,
            (bool)$this->cookie_httponly
        );
    }
1153389
static public function getCookie($name= null)
    {
        if ($name) $name = static::$COOKIE_PREFIX . $name;
        return empty($name) ? $_COOKIE : (isset($_COOKIE[$name]) ? $_COOKIE[$name] : '');
    }
542150
public function setCookies(array $cookies)
	{
		$this->cookies = [];
		
		foreach($cookies as $name => $value)
		{
			$this->setCookie($name, $value);
		}
		
		return $this;
	}
1307569
public function removeCookie($name)
	{
		$cookie = new SetCookieHeader($name, '');
		$cookie->setExpires(1337);
		
		$this->addHeader($cookie);
		
		return $this;
	}
890040
public static function create($name, array $properties = [], $serialize = true) {

        try {

            $class = get_called_class();

            $cookie = new $class($name);

            CookieTools::setCookieProperties($cookie, $properties, $serialize);

        } catch (CookieException $ce) {

            throw $ce;

        }

        return $cookie;

    }
18048
public static function serializeCookies(\Yee\Http\Headers &$headers, \Yee\Http\Cookies $cookies, array $config)
    {
        if ($config['cookies.encrypt']) {
            foreach ($cookies as $name => $settings) {
                if (is_string($settings['expires'])) {
                    $expires = strtotime($settings['expires']);
                } else {
                    $expires = (int) $settings['expires'];
                }

                $settings['value'] = static::encodeSecureCookie(
                    $settings['value'],
                    $expires,
                    $config['cookies.secret_key'],
                    $config['cookies.cipher'],
                    $config['cookies.cipher_mode']
                );
                static::setCookieHeader($headers, $name, $settings);
            }
        } else {
            foreach ($cookies as $name => $settings) {
                static::setCookieHeader($headers, $name, $settings);
            }
        }
    }
1273593
public function cookie($name, $value=null) 
    {
        $str = '';
        if (is_array($name)) {
            $arr = [];
            foreach ($name as $k=>$v) {
                $arr[] = $k . '=' . $v;
            }
            $str = implode(';', $arr);
        } elseif ($value) {
            $str = $name . '=' . $value;
        } else {
            $str = $name;
        }
        
        $this->def['cookie'] = $this->def['cookie'] ? $this->def['cookie'].';'.$str : $str;

        return $this;
    }
902802
protected function encodePropertyName($name, $preserveNames)
	{
		return ($preserveNames || !$this->isLegalProp($name)) ? json_encode($name) : $name;
	}
1312286
public function getCookie($name) {
    $cookies = $this->browser->cookies();
    foreach ($cookies as $cookie) {
      if ($cookie instanceof Cookie && strcmp($cookie->getName(), $name) === 0) {
        return $cookie->getValue();
      }
    }
    return null;
  }
377878
public static function setCookie(
        ResponseInterface $response,
        /*# string */ $name,
        /*# string */ $value = null,
        /*# int */ $ttl = null,
        /*# string */ $path = null,
        /*# string */ $domain = null,
        /*# bool */ $secure = false,
        /*# bool */ $httponly = true
    )/*# : ResponseInterface */ {
        $cookie = urlencode($name) . '=' . urlencode($value);

        self::addExpire($cookie, $ttl);

        self::addDomain($cookie, $domain);

        self::addPath($cookie, $path);

        self::addSecure($cookie, $secure);

        self::addHttpOnly($cookie, $httponly);

        return $response->withAddedHeader('Set-Cookie', $cookie);
    }
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];
	}
1073391
public function delete( $name ) {
		unset( $this->cookie[ $name ] ); // Input var okay.
		return $this->set( $name, null, time() - 15 * 60 );
	}
1137243
public static function delete($name)
    {
        unset($_COOKIE[$name]);
        return Base::getHttp()->setCookie($name, null, -86400, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httpOnly);
    }
668039
static public function getCookie($name=null)
    {
        $prefix = $this->options['group'] ? $this->options['group'] . '_' : 'WS_';
        if ($name) $name =  $prefix . $name;
        return HttpHelper::getCookie($name);
    }