根据cookie名和内容，生成一个salt

$salt = Cookie::salt('theme', 'red');

@param  string $name  cookie名
@param  string $value cookie值
@return string
@throws HelperException
198587
public static function salt($name, $value)
    {
        $agent = strtolower(Arr::get($_SERVER, 'HTTP_USER_AGENT', 'unknown'));

        return sha1($agent . $name . $value . Cookie::$salt);
    }
560022
public function set($name, $value = null, $time = 2592000)
    {
        $value = json_encode($value);
        parent::set($name, $value);

        setcookie($name, $value, time() + $time, '/', $this->server->get('name'));
    }
1045025
public function modifyRequestCookie($request, $name, $value = null)
    {
        $modify = function (Cookie $cookie) {
            $value = $cookie->getValue();

            return $cookie->withValue($value);
        };

        $request = FigRequestCookies::modify($request, $name, $modify);

        return $request;
    }
316638
public function add($name, $value = null, array $params = [])
    {
        if (is_array($value)) {
            $params = $value;
            if (isset($params['value'])) {
                $value = $params['value'];
                unset($params['value']);
            } else {
                $value = '';
            }
        }
    
        $params = array_merge($this->defaults, $params);
        $this->jar[$name] = new Cookie($name, $value, $params['expires'], $params['path'], $params['domain'], $params['secure'], $params['httponly'], $params['raw']);
        return $this;
    }
64318
public function set_cookie($name, $value = null)
	{
		is_null($value)
			? $this->connection()->__setCookie($name)
			: $this->connection()->__setCookie($name, $value);
	}
1033256
public function make( $name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true )
	{
		list( $path, $domain, $secure ) = $this->getPathAndDomain( $path, $domain, $secure );
		$time = ( $minutes == 0 ) ? 0 : time() + ( $minutes * 60 );

		return new Cookie( $name, $value, $time, $path, $domain, $secure, $httpOnly );
	}
45635
public function sendCookie(string $name, ?string $value, int $expire = 0,
        string $path = '/', string $domain = '', bool $secure = false, bool $httpOnly = false): void
    {
        // check name
        if (!preg_match('~^[a-z0-9_\-\.]+$~i', $name)) {
            throw new HttpException("Invalid cookie name '{$name}' given");
        }

        $value = (string) $value;
        if ($expire < 0) {
            $value = '';
        }

        setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
    }
1056105
public function set($name, $value, $secure=false)
    {
        $params = ['cookie' =>
            [
                'name' => $name,
                'value' => "{$value}",
                'secure' => $secure,
            ]
        ];
        $command = $this->driver->factoryCommand('cookie', WebDriver_Command::METHOD_POST, $params);
        $this->driver->curl($command);
    }
218392
function setcookie($name, $value = null, $expire = null, $path = '/', $domain = null, $secure = null, $httponly = null)
    {
        if ($value == null)
        {
            $value = 'deleted';
        }
        $cookie = "$name=$value";
        if ($expire)
        {
            $cookie .= "; expires=" . date("D, d-M-Y H:i:s T", $expire);
        }
        if ($path)
        {
            $cookie .= "; path=$path";
        }
        if ($secure)
        {
            $cookie .= "; secure";
        }
        if ($domain)
        {
            $cookie .= "; domain=$domain";
        }
        if ($httponly)
        {
            $cookie .= '; httponly';
        }
        $this->cookie[] = $cookie;
    }
1201645
public function setHeader($name, $value)
    {
        $internalName = strtolower($name);

        if (true === is_array($value)) {
            $this->headers[$internalName] = $value;
        } else {
            $this->headers[$internalName] = array($value);
        }
    }
49330
public function replace($name, $value)
    {
        $cookieList = [];
        foreach ($this->header->ls() as $hdr) {
            if (0 === \stripos($hdr, 'Set-Cookie: ')) {
                // found "Set-Cookie"
                if (0 !== \stripos($hdr, \sprintf('Set-Cookie: %s=', $name))) {
                    // not the one we want to replace, add to backup list
                    $cookieList[] = $hdr;
                }
            }
        }
        // remove all "Set-Cookie" headers, `header_remove()` is case
        // insensitive
        $this->header->remove('Set-Cookie');

        // restore cookies we want to keep
        foreach ($cookieList as $cookie) {
            $this->header->set($cookie, false);
        }

        $this->set($name, $value);
    }
1167368
public static function set($name, $value = '', $expire = 0)
    {
        !isset(self::$init) && self::init();

        if ($expire !== 0) {
            $expire = !empty(self::$config['expire']) ? $_SERVER['REQUEST_TIME'] + intval(self::$config['expire']) : 0;
        }

        if (is_string($name)) {
            setcookie(
                $name, $value, $expire, self::$config['path'],
                self::$config['domain'], self::$config['secure']
            );
        }

        if (is_array($name)) {
            foreach ($name as $item => $val) {
                setcookie(
                    $name, $val, $expire, self::$config['path'],
                    self::$config['domain'], self::$config['secure']
                );
            }
        }
    }
1007963
public function set($name, $value, $expire=0, $path='', $domain='', $secure=FALSE, $httponly=FALSE) {
		$_COOKIE[$name] = $this->encrypt( $value );
		return setcookie($name, $_COOKIE[$name], $expire, $path, $domain, $secure, $httponly);
	}
1259536
protected function setCookie($name, $value = null)
    {
        if ($value !== null) {
            $this->cookie[$name] = $value;
        } elseif (isset($this->cookie[$name])) {
            unset($this->cookie[$name]);
        }
    }
241448
public function setRequestCookie($request, $name, $value = null)
    {
        if (empty($name)) {
            return false;
        }

        $request = FigRequestCookies::set($request, Cookie::create($name, $value));

        return $request;
    }
826968
public function cookie(string $name): string {
        if (!isset($this->cookies[$name])) {
            return "";
        }
        return $this->cookies[$name];
    }
1086741
public function setCookie($name, $value, $expire = 0, $path = null, $domain = null, $secure = false, $httpOnly = true)
    {
        $context = $this->_context;

        if ($expire > 0) {
            $current = time();
            if ($expire < $current) {
                $expire += $current;
            }
        }

        $context->cookies[$name] = [
            'name' => $name,
            'value' => $value,
            'expire' => $expire,
            'path' => $path,
            'domain' => $domain,
            'secure' => $secure,
            'httpOnly' => $httpOnly
        ];

        $globals = $this->request->getGlobals();

        $globals->_COOKIE[$name] = $value;

        return $this;
    }