@see parent::setCookie()

@param $name
@param null $value
@param null $expire
@param null $domainPath
@param null $https
@param null $httpOnly
@return bool|void
196106
public function setCookie($name, $value = null, $expire = null,
                              $domainPath = null, $https = null, $httpOnly = null)
    {
        if (!$this->response) {
            return $this->getResponse()->setCookie($name, $value, $expire, $domainPath, $https, $httpOnly);
        }
        return parent::setCookie($name, $value, $expire, $domainPath, $https, $httpOnly);
    }
1057558
public function set(
        $name = '',
        $value = '',
        $expire = 0,
        $path = '/',
        $domain = '',
        $secure = false,
        $httpOnly = false
    ) {
        if (empty($value)) {
            Craft::$app->response->cookies->remove($name);
        } else {
            $domain = empty($domain) ? Craft::$app->getConfig()->getGeneral()->defaultCookieDomain : $domain;
            $expire = (int)$expire;
            setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
            $_COOKIE[$name] = $value;
        }
    }
119552
public function addCookie($name, $value = null)
    {
        if (is_array($name)) {
            $this->cookies = $name + $this->cookies;
        } else {
            $this->cookies[$name] = $value;
        }
    }
782753
public function rawcookie($name, $value = null, $expire = null, $path = '/', $domain = null, $secure = null, $httponly = null)
    {
        $cookie = [];
        foreach (['name', 'value', 'expire', 'path', 'domain', 'secure', 'httponly'] as $key) {
            $cookie[$key] = $$key;
        }
        $this->cookie[] = $cookie;
    }
1267851
public function set($name, $value, $expire) {
        if (is_null($expire)) {
            $expire = $this->options['expire'];
        }
        $filename = $this->setCacheKey($name);

        $data = serialize($value);
        $data = "<?php\n//" . sprintf('%012d', $expire) . $data . "\n?>";
        file_put_contents($filename, $data);
    }
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;
    }
1143030
protected function setCookie($key, $value = null, $expire = 0)
    {
        if ($value === null) {
            Arr::forget($_COOKIE, $key);
        } else {
            if ($this->defaults['encrypt']) {
                $value = $this->getEncryption()->encryptBase64($value);
            }

            Arr::set($_COOKIE, $key, $value);
        }

        setcookie(
            $key,
            $value,
            $expire,
            $this->defaults['path'],
            $this->defaults['domain'],
            $this->defaults['secure'],
            $this->defaults['httponly']
        );
    }
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;
    }
412130
public function addCookie($name, $value, $expire = null, $path = null)
    {
        $this->cookies[$name] = [
            'value' => $value,
            'expire' => $expire,
            'path' => $path
        ];
        return $this;
    }
589816
public void setCookie(String name, String value, String path, Date expirationDate, boolean secure, boolean httpOnly) {
        if (remote == null)
            throw new IllegalStateException("Cannot setCookie since remote == null");
        if (path == null || path.length() == 0)
            path = remote.getPath();
        Cookie.Builder builder = new Cookie.Builder();
        builder.name(name).value(value).domain(remote.getHost()).path(path);
        if (expirationDate != null)
            builder.expiresAt(expirationDate.getTime());
        List<Cookie> cookies = Collections.singletonList(builder.build());
        this.clientFactory.addCookies(cookies);
    }
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'));
    }
335279
public function setCookie(
        $name,
        $value,
        $expires = null,
        $path = null,
        $domain = null,
        $secure = null,
        $httpOnly = null
    ) {
        $expires  = is_null($expires) ? $this->vitex->getConfig('cookies.lifetime') : $expires;
        $path     = is_null($path) ? $this->vitex->getConfig('cookies.path') : $path;
        $domain   = is_null($domain) ? $this->vitex->getConfig('cookies.domain') : $domain;
        $secure   = is_null($secure) ? $this->vitex->getConfig('cookies.secure') : $secure;
        $httpOnly = is_null($httpOnly) ? $this->vitex->getConfig('cookies.httponly') : $httpOnly;
        if (!is_numeric($expires)) {
            $expires = strtotime($expires);
        }
        $secret_key = $this->vitex->getConfig('cookies.secret_key');
        $encrypt    = $this->vitex->getConfig('cookies.encrypt');
        if ($encrypt) {
            $value = Utils::encrypt($value, $secret_key);
        }
        setcookie($name, $value, $expires, $path, $domain, $secure, $httpOnly);
    }
1340685
public function setHeader(string $name, $value)
    {
        parent::setHeader($name, $value);

        if (\stripos($name, "set-cookie") === 0) {
            $this->setCookiesFromHeaders();
        }
    }
768786
public static function cookie($name, $value = null, $expire = null, $path = null, $domain = null, $security = null) {
        $settings       = App::cfg();
        $cookie_setting = array_merge2([
            'expire'   => 0,
            'path'     => '/',
            'domain'   => '',
            'security' => false
        ], $settings->get('cookie', []));
        if ($expire == null) {
            $expire = intval($cookie_setting ['expire']);
        }
        if ($path == null) {
            $path = $cookie_setting ['path'];
        }
        if ($domain == null) {
            $domain = $cookie_setting ['domain'];
        }
        if ($security == null) {
            $security = $cookie_setting ['security'];
        }
        if ($expire != 0) {
            $expire = time() + $expire;
        }
        @setcookie($name, $value, $expire, $path, $domain, $security);
    }
1100105
public function withCookie($key, $value, $expire = 0, $path = '/', $domain = '', $secure = false, $httponly = false)
    {
        $self = clone $this;
        $self->cookies[] = [
            'key'       => $key,
            'value'     => $value,
            'expire'    => $expire,
            'path'      => $path,
            'domain'    => $domain,
            'secure'    => $secure,
            'httponly'  => $httponly,
        ];
        return $self;
    }
443284
public function set(
        $name,
        $value,
        $lifetime = null,
        $path = '/',
        $domain = null,
        $secure = false,
        $httpOnly = false
    )
    {
        if($lifetime !== null) {
            $expires = time() + $lifetime;
            
        }else{
            $expires = null;
        }
        
        if($lifetime < 0) {
            unset($this->cookies[$name]);
            
        }else {
            $this->cookies[$name] = $value;            
        }
        
        $this->updates[$name] = $this->builder->cookiesUpdate(
            $name,
            $value,
            $expires,
            $path,
            $domain,
            $secure,
            $httpOnly
        );
    }
1306733
public function addCookie($name, $value, $expire = null, $path = null, $domain = null)
    {
        if (!is_null($expire)) {
            $expire = time() + $expire;
        }
        setcookie($name, $value, $expire, $path, $domain);
    }