set_cookies
Set cookies directly in the real browser profile to restore sessions, manage authentication, or prepare test states. Supports HttpOnly and cross-path cookies via CDP.
Instructions
Write cookies into the real browser profile. Takes one cookie object or a list (JSON text is accepted): name is required, plus optional value/url/domain/path/expires (Unix seconds)/httpOnly/secure/sameSite. Uses CDP Network.setCookie so HttpOnly and cross-path cookies work; falls back to document.cookie only if CDP is unavailable, and then says which cookies could not carry HttpOnly. Cookies with neither url nor domain are scoped to the current page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab_id | No | ||
| cookies | Yes | ||
| timeout | No | ||
| session_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||