Network.setCookie

Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

{
  "name": "setCookie",
  "parameters": [
    {
      "name": "url",
      "type": "string",
      "description": "The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie."
    },
    {
      "name": "name",
      "type": "string",
      "description": "The name of the cookie."
    },
    {
      "name": "value",
      "type": "string",
      "description": "The value of the cookie."
    },
    {
      "name": "domain",
      "type": "string",
      "optional": true,
      "description": "If omitted, the cookie becomes a host-only cookie."
    },
    {
      "name": "path",
      "type": "string",
      "optional": true,
      "description": "Defaults to the path portion of the url parameter."
    },
    {
      "name": "secure",
      "type": "boolean",
      "optional": true,
      "description": "Defaults ot false."
    },
    {
      "name": "httpOnly",
      "type": "boolean",
      "optional": true,
      "description": "Defaults to false."
    },
    {
      "name": "sameSite",
      "$ref": "CookieSameSite",
      "optional": true,
      "description": "Defaults to browser default behavior."
    },
    {
      "name": "expirationDate",
      "$ref": "Timestamp",
      "optional": true,
      "description": "If omitted, the cookie becomes a session cookie."
    }
  ],
  "returns": [
    {
      "name": "success",
      "type": "boolean",
      "description": "True if successfully set cookie."
    }
  ],
  "description": "Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.",
  "handlers": [
    "browser"
  ],
  "async": true,
  "experimental": true
}