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;
    }
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;
    }
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 ; }
Sets a cookie to be sent at the end of the request

@param string $name
@param mixed  $value
@param int    $expire
@param string $path
@param string $domain
@param bool   $secure
@param bool   $httpOnly

@return static
Sets a cookie to be sent at the end of the request