code: function set(key, value, encoder = encodeURIComponent, options) {
    if (typeof encoder === 'object' && encoder !== null) {
      /* eslint-disable no-param-reassign */
      options = encoder;
      encoder = encodeURIComponent;
      /* eslint-enable no-param-reassign */
    }
    const attrsStr = convert(options || {});
    const valueStr = typeof encoder === 'function' ? encoder(value) : value;
    const newCookie = `${key}=${valueStr}${attrsStr}`;
    document.cookie = newCookie;
  }
docs: Set a cookie.