src/web/Cookie.php
public static function set($name, $value, $expiration = null) {
        if ($expiration === null) {
            // Use the default expiration
            $expiration = static::$expiration;
        }

        if ($expiration !== 0) {
            // The expiration is expected to be a UNIX timestamp
            $expiration += time();
        }

        // Add the salt to the cookie value
        $value = static::salt($name, $value) . '~' . $value;

        return setcookie($name, $value, $expiration, static::$path, static::$domain, static::$secure, static::$httponly);
    }
public static function set($name, $value, $expiration = null) {
        if ($expiration === null) {
            // Use the default expiration
            $expiration = static::$expiration;
        }

        if ($expiration !== 0) {
            // The expiration is expected to be a UNIX timestamp
            $expiration += time();
        }

        // Add the salt to the cookie value
        $value = static::salt($name, $value) . '~' . $value;

        return setcookie($name, $value, $expiration, static::$path, static::$domain, static::$secure, static::$httponly);
    }
public static function set ( $ name , $ value , $ expiration = null ) { if ( $ expiration === null ) { // Use the default expiration $ expiration = static :: $ expiration ; } if ( $ expiration !== 0 ) { // The expiration is expected to be a UNIX timestamp $ expiration += time ( ) ; } // Add the salt to the cookie value $ value = static :: salt ( $ name , $ value ) . '~' . $ value ; return setcookie ( $ name , $ value , $ expiration , static :: $ path , static :: $ domain , static :: $ secure , static :: $ httponly ) ; }
Sets a signed cookie. Note that all cookie values must be strings and no
automatic serialization will be performed!

// Set the "theme" cookie
Cookie::set('theme', 'red');

@param   string $name name of cookie
@param   string $value value of cookie
@param   integer $expiration lifetime in seconds
@return  boolean
@uses    Cookie::salt
Sets a signed cookie . Note that all cookie values must be strings and no automatic serialization will be performed!