Create new cookie.

@param string $name
@param string $value
@param int    $lifetime By minutes
@param string $path

@return null
421356
public static function create($name, $value, $lifetime, $path = '/')
    {
        $expire = self::lifetime($lifetime);

        return setcookie($name, $value, $expire, $path);
    }
446369
public function make(string $name, int $expireTime = 604800, string $path = "/", string $domain = "", bool $secure = false, bool $httpOnly = true)
  {
    return new PHPCookie($name, $expireTime, $path, $domain, $secure, $httpOnly);
  }
412013
public static function put($name, $value, $expiration = 0, $path = '/', $domain = null, $secure = false)
    {
        if ($expiration !== 0) {
            $expiration = time() + ($expiration * 60);
        }

        $value = static::hash($value) . '+' . $value;

        // are we attempting to send a secure cookie over the insecure HTTP.
        if ($secure === true && Config::get('ssl') === false) {
            throw new \RuntimeException("Attempting to set secure cookie over HTTP!");
        }

        static::$jar[$name] = compact('name', 'value', 'expiration', 'path', 'domain', 'secure');

        return true;
    }
24433
public function set($name, $value, $ttl = 86400 /* 1 day */, $path = '/', $domain = '', $secure = false, $http_only = false) {
        $this->_cookies[$name] = $value;
        $result = \setcookie($name, $value, time() + $ttl, $path, $domain, $secure, $http_only);

        if (isset($this->_deleted_cookies[$name])) {
            unset($this->_deleted_cookies[$name]);
        }

        return $result;
    }
684893
protected function setCookie($name, $value = '') {
    if (PHP_SAPI === 'cli') {
      return;
    }

    $current_request = $this->requestStack->getCurrentRequest();
    if (isset($current_request->cookies)) {
      $current_request->cookies->set("Drupal_visitor_{$name}", $value);
    }
    user_cookie_save([
      $name => $value,
    ]);
  }
1142058
public function set($name, $value, $expire = NULL) {
        if (isset($this->config['crypt'])) {
            $value = $this->config['crypt']->encrypt($value, $this->config['key']);
        }

        $_COOKIE[$name] = $value;
        if ($expire < $_SERVER['REQUEST_TIME']) {
            unset($_COOKIE[$name]);
        }

        return parent::set($name, $value, $expire);
    }
202181
public static function put($name, $value, $lifetime)
    {
        return self::driver()->put($name, $value, $lifetime);
    }
317923
public static void setCookie(HttpServletResponse response, String name, String value, String path) {

		Cookie cookie = new Cookie(name, value);
		cookie.setSecure(false);
		cookie.setPath(path);
		cookie.setMaxAge(3600 * 24 * 30); // 30 days

		response.addCookie(cookie);
	}
1123287
public function set($name, $value = null, $minutes = null, $path = null, $domain = null, $secure = false, $httpOnly = true)
    {
        $minutes = is_null($minutes) ? config('session.lifetime', 0) : $minutes;

        $this->queue($name, $value, $minutes, $path, $domain, $secure, $httpOnly);

        return true;
    }
527994
protected function setCookie($name, $value)
	{
		// add the current time so we have an offset
		$expiration = $this->expiration > 0 ? $this->expiration + time() : 0;

		return setcookie($name, $value, $expiration, $this->config['cookie_path'], $this->config['cookie_domain'], $this->config['cookie_secure'], $this->config['cookie_http_only']);
	}
1053530
public static function set_cookie(
        $name,
        $value,
        $expiry = 90,
        $path = null,
        $domain = null,
        $secure = false,
        $httpOnly = false
    ) {
        Deprecation::notice('0.2', 'This method is no longer required. Please use Cookie::set');
        Cookie::set($name, $value, $expiry, $path, $domain, $secure, $httpOnly);
    }
662373
public function setCookie(
        $name = "",
        $value = "",
        $expire = 0,
        $path = "/",
        $domain = "",
        $secure = false,
        $httpOnly = false
    ) {
        Cookies::$plugin->cookies->set(
            $name,
            $value,
            $expire,
            $path,
            $domain,
            $secure,
            $httpOnly
        );
    }
828191
public function set($name, $value, $expire = 604800, $path = '/', $domain = '')
    {
        if (empty($domain)) {
            // $domain = '.' . $_SERVER['HTTP_HOST'];
            setcookie($name, $value, $expire + time(), $path);
        } else {
            setcookie($name, $value, $expire + time(), $path, $domain);
        }

        // Make it come into effect immediately.
        $_COOKIE[$name] = $value;
    }
964537
public function newInstance($name, $value)
    {
        $class = $this->getClassFor($name);
        return new $class($this->consumerService, $name, $value);
    }
48092
public static function create(string $name, $value, int $expire = 1209600)
    {
        $cookieText = 'Set-Cookie: '.$name.'='.$value;
        
        $expireTime = new \DateTime;
        $expireTime->modify('+ '.$expire.' second');
        $cookieText .= '; Expires='.$expireTime->format('D, d M Y H:i:s e');
        
        $cookieText .= '; Path='.self::$path;
        $cookieText .= '; Domain='.self::$domain;
        
        if (self::$httpOnly === true) {
            $cookieText .= '; HttpOnly';
        }
        
        if (self::$secure === true) {
            $cookieText .= '; Secure';
        }
        
        if (!empty(self::$sameSite)) {
            $cookieText .= '; Samesite='.self::$sameSite;
        }
        
        header($cookieText);
    }
1110452
public function add(string $name, string $value): void
	{
		$this->cookies[$name] = $value;
	}
674858
public function set($key, $value, $lifeTime)
    {

        $path = $this->getKeyPath($key);
        $dir = dirname($path);

        if (!is_dir($dir))
            mkdir($dir, 0777, true);

        $this->_lifeTimes[$key] = intval($lifeTime);

        //Save the life times
        $this->_format->save($this->_lifeTimePath, $this->_lifeTimes);

        //Save the cache content
        $this->_format->save($path, $value);

        return $this;
    }