src/Response.php
public static function globalCookies($name = null, $value = false, $expires = 0, $path = null, $domain = null, $secure = false, $httponly = false) {
        if (self::$globalCookies === null) {
            self::$globalCookies = [];
        }

        if ($name === null) {
            return self::$globalCookies;
        }

        if ($value === false) {
            return val($name, self::$globalCookies);
        }

        self::$globalCookies[$name] = [$value, $expires, $path, $domain, $secure, $httponly];
        return null;
    }
public static function globalCookies($name = null, $value = false, $expires = 0, $path = null, $domain = null, $secure = false, $httponly = false) {
        if (self::$globalCookies === null) {
            self::$globalCookies = [];
        }

        if ($name === null) {
            return self::$globalCookies;
        }

        if ($value === false) {
            return val($name, self::$globalCookies);
        }

        self::$globalCookies[$name] = [$value, $expires, $path, $domain, $secure, $httponly];
        return null;
    }
Gets or sets a global cookie.

Global cookies are used when you want to set a cookie, but a {@link Response} has not been created yet.

@param string $name The name of the cookie.
@param bool $value The value of the cookie. This value is stored on the clients computer; do not store sensitive information.
@param int $expires The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch.
@param string $path The path on the server in which the cookie will be available on.
If set to '/', the cookie will be available within the entire {@link $domain}.
@param string $domain The domain that the cookie is available to.
@param bool $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client.
@param bool $httponly When TRUE the cookie will be made accessible only through the HTTP protocol.
@return mixed|null Returns the cookie settings at {@link $name} or `null` when setting a cookie.