Learn how to add cookies to your Stably tests
context.addCookies()
method.
context.addCookies()
method to add one or more cookies:
Property | Type | Required | Description |
---|---|---|---|
name | string | β | The name of the cookie |
value | string | β | The value of the cookie |
domain | string | β | The domain for which the cookie is valid |
path | string | β | The path for which the cookie is valid (defaults to β/β) |
expires | number | β | Expiration time as Unix timestamp in seconds |
httpOnly | boolean | β | Whether the cookie is HTTP-only |
secure | boolean | β | Whether the cookie requires HTTPS |
sameSite | string | β | SameSite attribute (βStrictβ, βLaxβ, or βNoneβ) |