src/Common/Service/Cookie.php
public function write(
        string $sKey,
        string $sValue,
        int $iTTL = null,
        string $sPath = '',
        string $sDomain = '',
        bool $bSecure = false,
        bool $bHttpOnly = false
    ): bool {
        if (setcookie($sKey, $sValue, $iTTL ? time() + $iTTL : 0, $sPath, $sDomain, $bSecure, $bHttpOnly)) {
            $this->aCookies[$sKey] = Factory::resource(
                'Cookie',
                null,
                (object) [
                    'key'   => $sKey,
                    'value' => $sValue,
                ]
            );
            return true;
        }

        return false;
    }
public function write(
        string $sKey,
        string $sValue,
        int $iTTL = null,
        string $sPath = '',
        string $sDomain = '',
        bool $bSecure = false,
        bool $bHttpOnly = false
    ): bool {
        if (setcookie($sKey, $sValue, $iTTL ? time() + $iTTL : 0, $sPath, $sDomain, $bSecure, $bHttpOnly)) {
            $this->aCookies[$sKey] = Factory::resource(
                'Cookie',
                null,
                (object) [
                    'key'   => $sKey,
                    'value' => $sValue,
                ]
            );
            return true;
        }

        return false;
    }
public function write ( string $ sKey , string $ sValue , int $ iTTL = null , string $ sPath = '' , string $ sDomain = '' , bool $ bSecure = false , bool $ bHttpOnly = false ) : bool { if ( setcookie ( $ sKey , $ sValue , $ iTTL ? time ( ) + $ iTTL : 0 , $ sPath , $ sDomain , $ bSecure , $ bHttpOnly ) ) { $ this -> aCookies [ $ sKey ] = Factory :: resource ( 'Cookie' , null , ( object ) [ 'key' => $ sKey , 'value' => $ sValue , ] ) ; return true ; } return false ; }
Writes a cookie, or overwrites an existing one

@param string   $sKey   The cookie's key
@param string   $sValue The cookie's value
@param int|null $iTTL   The cookie's TTL in seconds

@return bool
Writes a cookie or overwrites an existing one