cookie(name, value, expiry, options, sign_cookie = true) {
        // Determine if this is a delete operation and recursively call self with appropriate options
        if (name && value === null)
            return this.cookie(name, '', null, {
                maxAge: 0,
            });

        // If an options object was not provided, shallow copy it to prevent mutation to the original object
        // If an options object was not provided, create a new object with default options
        options = options
            ? { ...options }
            : {
                  secure: true,
                  sameSite: 'none',
                  path: '/',
              };

        // Determine if a expiry duration was provided in milliseconds
        if (typeof expiry == 'number') {
            // Set the expires value of the cookie if one was not already defined
            options.expires = options.expires || new Date(Date.now() + expiry);

            // Define a max age if one was not already defined
            options.maxAge = options.maxAge || Math.round(expiry / 1000);
        }

        // Sign cookie value if signing is enabled and a valid secret is provided
        if (sign_cookie && typeof options.secret == 'string') {
            options.encode = false; // Turn off encoding to prevent loss of signature structure
            value = signature.sign(value, options.secret);
        }

        // Initialize the cookies holder object if it does not exist
        if (this._cookies == undefined) this._cookies = {};

        // Store the seralized cookie value to be written during response
        this._cookies[name] = cookie.serialize(name, value, options);
        return this;
    }
This method is used to write a cookie to incoming request.
To delete a cookie, set the value to null.

@param {String} name Cookie Name
@param {String|null} value Cookie Value
@param {Number=} expiry In milliseconds
@param {CookieOptions=} options Cookie Options
@param {Boolean=} sign_cookie Enables/Disables Cookie Signing
@returns {Response} Response (Chainable)