code: function serialize(name, val, options) {
    var opt = options || {};
    var enc = opt.encode || encode;
    var pairs = [name + '=' + enc(val)];
  
    if (null != opt.maxAge) {
      var maxAge = opt.maxAge - 0;
      if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
      pairs.push('Max-Age=' + maxAge);
    }
  
    if (opt.domain) pairs.push('Domain=' + opt.domain);
    if (opt.path) pairs.push('Path=' + opt.path);
    if (opt.expires) pairs.push('Expires=' + opt.expires.toUTCString());
    if (opt.httpOnly) pairs.push('HttpOnly');
    if (opt.secure) pairs.push('Secure');
    if (opt.firstPartyOnly) pairs.push('First-Party-Only');
  
    return pairs.join('; ');
  }
docs: Serialize data into a cookie header.
  
  Serialize the a name value pair into a cookie string suitable for
  http headers. An optional options object specified cookie parameters.
  
  serialize('foo', 'bar', { httpOnly: true })
  => "foo=bar; httpOnly"
  
  @param {string} name
  @param {string} val
  @param {object} [options]
  @return {string}
  @public