Skip to main content

Set Cookies

POST 

/workstations/:workstation_id/browser/cookies

Set one or more cookies in the browser's default context. These cookies will be available across all tabs.

Required fields for each cookie:

  • name: Cookie name
  • value: Cookie value

Optional fields:

  • domain: Cookie domain (e.g., ".example.com")
  • path: Cookie path (default: "/")
  • expires: Expiration time in seconds since Unix epoch (-1 for session cookies)
  • http_only: Whether cookie is HTTP-only (default: false)
  • secure: Whether cookie requires HTTPS (default: false)
  • same_site: Cookie SameSite policy ("strict", "lax", or "none")
  • priority: Cookie priority ("low", "medium", or "high") - Chrome only
  • same_party: Whether cookie is same-party - Chrome only
  • source_scheme: Cookie source scheme type - Chrome only
  • partition_key: Cookie partition key for isolation
  • partition_key_opaque: Whether partition key is opaque - Chrome only

Example usage:

// Set a session cookie
await fetch('/workstations/{id}/browser/cookies', {
method: 'POST',
body: JSON.stringify({
cookies: [{
name: 'sessionId',
value: 'abc123',
domain: '.example.com',
http_only: true,
secure: true
}]
})
});

// Set multiple cookies
await fetch('/workstations/{id}/browser/cookies', {
method: 'POST',
body: JSON.stringify({
cookies: [
{
name: 'theme',
value: 'dark',
domain: 'app.example.com'
},
{
name: 'lang',
value: 'en-US',
domain: '.example.com',
expires: 1735689600
}
]
})
});

Request

Responses

No Content - the operation was successful but there is no additional content to return.