Fundamentals/Beginner
Cookies
Parsing, serializing, and injecting cookies to maintain persistent session states and bypass repeat logins.
Dependency Path
Requires:
Used By:
Environment Target
Compatibility: Chrome >= 110
Last Reviewed: 2026-07-18
Recipes: 10 (6 cookbook / 4 playbook)
Why It Matters
Parsing, serializing, and injecting cookies to maintain persistent session states and bypass repeat logins.Also known as: cookie, cookie jar, session cookie.
cookieshttpstate
Cookies are key-value state parameters sent by the browser in HTTP headers. In browser automation, dumping active cookies allows you to recreate states without walking through interactive login steps.
Strategic Implementation
- JSON Serialization: Convert cookies into array schemas containing expiry dates, domain bounds, and paths.
- Injecting Before Navigation: Set cookies via CDP before triggering page navigation to prevent redirection loops.
- Decoupled domains: Inject cookies targeting specific subdomains separately to honor security scopes.
Example Recipes
+4 more recipes in the knowledge base