toString () {
        var str = Cookie.unparseSingle(this);

        if (this.expires && this.expires instanceof Date) {
            // check for valid date
            if (!Number.isNaN(this.expires.getTime())) {
                str += '; Expires=' + this.expires.toUTCString();
            }
        }
        else if (this.expires) {
            str += '; Expires=' + this.expires;
        }

        if (this.maxAge && this.maxAge !== Infinity) {
            str += '; Max-Age=' + this.maxAge;
        }

        if (this.domain && !this.hostOnly) {
            str += '; Domain=' + this.domain;
        }

        if (this.path) {
            str += '; Path=' + this.path;
        }

        if (this.secure) {
            str += '; Secure';
        }

        if (this.httpOnly) {
            str += '; HttpOnly';
        }

        if (this.extensions) {
            this.extensions.forEach(({ key, value }) => {
                str += `; ${key}`;
                str += value === true ? '' : `=${value}`;
            });
        }

        return str;
    }
Converts the Cookie to a single Set-Cookie header string.

@returns {String}