Setea parametros de cookie
@param int $lifetime
@param string $path
@param string $domain
@param bool $secure
@param bool $httponly
@return bool
515208
public function setCookieParams($lifetime, $path=NULL, $domain=NULL, $secure=FALSE, $httponly= FALSE){
        session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly);
    }
464470
public function removeCookie($name, $path = '/', $domain = null)
    {
        //Ensure we have a valid path
        if (empty($path)) {
            $path = '/';
        }

        //Force to string to allow passing objects
        $path = (string) $path;

        unset($this->_cookies[$domain][$path][$name]);

        if (empty($this->_cookies[$domain][$path]))
        {
            unset($this->_cookies[$domain][$path]);

            if (empty($this->_cookies[$domain])) {
                unset($this->_cookies[$domain]);
            }
        }
    }
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);
    }
1134304
protected function setCookie($name, $value = null, $expire = null, $domainPath = null, $https = null, $httpOnly = null)
    {
        return setcookie($name, $value, $expire, $domainPath, $https, $httpOnly);
    }
480523
public function setCookies($cookiedomain, $cookiepath, $expires=0, $secure=0, $httponly=1)
	{
		$cookies = $this->parsecookies($this->cookies);
		foreach ($cookies as $cookie) {
			$name = '';
			$value = '';
			if ($expires == 0) {
				$expires_time = 0;
			} else {
				$expires_time = time()+$expires;
			}
			if (isset($cookie['value']['key'])) {
				$name = $cookie['value']['key'];
			}
			if (isset($cookie['value']['value'])) {
				$value = $cookie['value']['value'];
			}
			if (isset($cookie['expires'])) {
				$expires_time = $cookie['expires'];
			}
			if (!$cookiepath) {
				if (isset($cookie['path'])) {
					$cookiepath = $cookie['path'];
				}
			}
			if (!$cookiedomain) {
				if (isset($cookie['domain'])) {
					$cookiedomain = $cookie['domain'];
				}
			}
			$this->status['debug'][] = $this->addCookie($name, urldecode($value), $expires_time, $cookiepath, $cookiedomain, $secure, $httponly);
			if ($name == 'MOODLEID_') {
				$this->status['cURL']['moodle'] = urldecode($value);
			}
		}
		return $this->status;
	}
1114841
public function forever(
        $name = '',
        $value = '',
        $path = '/',
        $domain = null,
        $secure = false,
        $httpOnly = false
    ) {
        $this->set($name, $value, 2628000, $path, $domain, $secure, $httpOnly);
        return $this;
    }
710956
public static function make(
        $name = '',
        $value = '',
        $expires = 0,
        $path = '/',
        $domain = null,
        $secure = false,
        $httpOnly = false
    ) {

        return new self($name, $value, $expires, $path, $domain, $secure, $httpOnly);
    }
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
        );
    }
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;
        }
    }
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);
  }
175370
public function make($name, $value, $minute = null, $path = "/", $domain = null, $secure = null, $httpOnly = true)
    {
        $this->toString = $value;
        if ($minute === 0) {
            $timez = 0;
        } else {
            $timez = time() + ($minute * 60);
        }
        if ($secure===null and isset($_SERVER['HTTPS'])) {
            $secure = true;
        }
        if ($domain===null) {
            $domain = Configer::getCookieDefaultDomain();
        }
        $this->func        = function ($value) use ($name, $timez, $path, $domain, $secure, $httpOnly) {
            setcookie($name, $value, $timez, $path, $domain, $secure, $httpOnly);
        };
        return new InputUtilities($this->toString, $this->func);
    }
1348750
protected function setCookie($value, $lifetime, $path = null, $domain = null, $secure = null, $httpOnly = null)
    {
        setcookie(
            $this->options['name'],
            json_encode($value),
            $lifetime,
            $path ?: $this->options['path'],
            $domain ?: $this->options['domain'],
            $secure ?: $this->options['secure'],
            $httpOnly ?: $this->options['http_only']
        );
    }
1022340
public function regenerate($destroy = false, $lifetime = null)
    {
        if (!$this->isStarted()) {
            return false;
        }
        
        if (null !== $lifetime) {
            ini_set('session.cookie_lifetime', $lifetime);
        }
    
        \Wslim\Ioc::logger('session')->debug(sprintf('[%s]regenerate', static::getId()));
        
        return session_regenerate_id($destroy);
    }
842979
public function setSecure(
        $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;
            $cookie = new Cookie(['name' => $name, 'value' => '']);

            try {
                $cookie->value = Craft::$app->security->hashData(base64_encode(serialize($value)));
            } catch (InvalidConfigException $e) {
                Craft::error(
                    'Error setting secure cookie: '.$e->getMessage(),
                    __METHOD__
                );

                return;
            } catch (Exception $e) {
                Craft::error(
                    'Error setting secure cookie: '.$e->getMessage(),
                    __METHOD__
                );

                return;
            }
            $cookie->expire = $expire;
            $cookie->path = $path;
            $cookie->domain = $domain;
            $cookie->secure = $secure;
            $cookie->httpOnly = $httpOnly;

            Craft::$app->response->cookies->add($cookie);
        }
    }
997479
public function setCookie($name, $value = null, $expire = null, $path = '/', $domain = '', $secure = false, $httponly = false){
        if(!$this->isEndResponse()){
            $this->withAddedCookie([
                $name,$value,$expire,$path,$domain,$secure,$httponly
            ]);
            return true;
        }else{
            return false;
        }

    }
722118
protected function add_cookie($domain, $name, $value, $path = '/', $expires = 0)
    {
        $file = fopen($this->cookie_file, 'a');

        if (!$file) {
            $this->error = 603;
        } else {
            fwrite($file, $domain . '	TRUE	' . $path . '	FALSE	' . $expires . '	' . $name . '	' . $value . "\r\n");
            fclose($file);
        }
    }
398447
public function set($name, $value, $path = null, $domain = null, $isSecure = null, \DateTime $expiry = null)
    {
        $cookie = new Cookie($name, $value, $path, $domain, $isSecure, $expiry);

        $this->setCookie($cookie);
    }