public function setcookie(
        $name,
        $value = '',
        $maxage = 0,
        $path = '',
        $domain = '',
        $secure = false,
        $HTTPOnly = false
    ) {
        $this->header(
            'Set-Cookie: ' . $name . '=' . rawurlencode($value)
            . (empty($domain) ? '' : '; Domain=' . $domain)
            . (empty($maxage) ? '' : '; Max-Age=' . $maxage)
            . (empty($path) ? '' : '; Path=' . $path)
            . (!$secure ? '' : '; Secure')
            . (!$HTTPOnly ? '' : '; HttpOnly'),
            false
        );
    }
public function setcookie(
        $name,
        $value = '',
        $maxage = 0,
        $path = '',
        $domain = '',
        $secure = false,
        $HTTPOnly = false
    ) {
        $this->header(
            'Set-Cookie: ' . $name . '=' . rawurlencode($value)
            . (empty($domain) ? '' : '; Domain=' . $domain)
            . (empty($maxage) ? '' : '; Max-Age=' . $maxage)
            . (empty($path) ? '' : '; Path=' . $path)
            . (!$secure ? '' : '; Secure')
            . (!$HTTPOnly ? '' : '; HttpOnly'),
            false
        );
    }
public function setcookie ( $ name , $ value = '' , $ maxage = 0 , $ path = '' , $ domain = '' , $ secure = false , $ HTTPOnly = false ) { $ this -> header ( 'Set-Cookie: ' . $ name . '=' . rawurlencode ( $ value ) . ( empty ( $ domain ) ? '' : '; Domain=' . $ domain ) . ( empty ( $ maxage ) ? '' : '; Max-Age=' . $ maxage ) . ( empty ( $ path ) ? '' : '; Path=' . $ path ) . ( ! $ secure ? '' : '; Secure' ) . ( ! $ HTTPOnly ? '' : '; HttpOnly' ) , false ) ; }
Set the cookie
@param string $name Name of cookie
@param string $value Value
@param integer $maxage Optional. Max-Age. Default is 0
@param string $path Optional. Path. Default is empty string
@param string $domain Optional. Domain. Default is empty string
@param boolean $secure Optional. Secure. Default is false
@param boolean $HTTPOnly Optional. HTTPOnly. Default is false
@return void
Set the cookie