cookie_import
Import cookies in bulk from JSON, header strings, Netscape files, or curl arguments to restore browser session state.
Instructions
Bulk-import cookies. Three input modes — pick whichever is easiest:
1. cookies=[{...}] inline array of dicts (DevTools / EditThisCookie shape)
2. file_path="..." JSON file (array OR storage_state {"cookies":[...]})
3. raw_text="..." paste any of these and we auto-parse:
• JSON array / object (same shapes as 1+2)
• Header string: "name=val; name2=val2" or
"Cookie: name=val; name2=val2"
• Netscape cookies.txt (tab-separated)
• curl --cookie / -b argument string
NOTE: header / netscape formats lack domain — pass default_domain=".example.com"
(or call this AFTER navigate so the active tab's URL provides it).
Per-cookie fields (when JSON):
{"name":"...", "value":"...", "domain":".example.com", "path":"/",
"expires":1234567890, "secure":true, "httpOnly":false, "sameSite":"Lax"}
Args:
cookies: inline array
file_path: JSON file
raw_text: any cookie text — format auto-detected
default_domain: fallback domain for header / netscape cookies (or auto-uses
current tab URL's host)
clear_first: wipe all existing cookies before import (default False)
For full cookies + localStorage + sessionStorage restore, use storage_state_load.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cookies | No | ||
| file_path | No | ||
| raw_text | No | ||
| default_domain | No | ||
| clear_first | No |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |