Cookie Nodes
Browser NodeManage browser cookies for authentication and session handling
Overview
Cookie nodes allow you to read, add, and clear cookies in the browser context. This is essential for handling authentication, maintaining sessions across workflows, and testing cookie-dependent features.
Available Nodes
Get Cookies
Retrieve cookies from the browser context
Parameters
Configuration options for this node
urlsString
Comma-separated URLs to get cookies for. If empty, gets all cookies.
Example:
https://example.com, https://api.example.comtargetVarString
Target Variable — stores the cookies array
Default:
cookiesCookie Object Properties:
{
name: "session_id",
value: "abc123",
domain: "example.com",
path: "/",
expires: 1735689600,
httpOnly: true,
secure: true,
sameSite: "Lax"
}Add Cookies
Add cookies to the browser context
Parameters
Configuration options for this node
cookiesJSON
Required
Cookies (JSON) — an array of cookie objects to add
Example:
[{"name": "auth", "value": "token123", "domain": ".example.com", "path": "/"}]Required Cookie Properties
Each cookie must have at least: name, value, and either url or domain + path. Other properties (expires, httpOnly, secure, sameSite) are optional.
Clear Cookies
Remove all cookies from the browser context
This node removes all cookies from the browser context. Use it to simulate a fresh session or to clean up after authentication tests.
Clearing cookies will log you out of most websites. You'll need to re-authenticate in subsequent steps. On a Chrome Automation Profile this also removes the profile's saved logins, since profiles keep their cookies between runs.
Usage Examples
Example 1: Save Session Cookies
Extract cookies after login for reuse
Workflow sequence:
- Open Page: https://example.com/login
- Fill login credentials
- Click Login button
- Wait for dashboard
- Get Cookies → sessionCookies
- Save to file/database for later use
Example 2: Restore Session
Skip login by adding saved cookies
Workflow sequence:
- Load cookies from file/database
- Add Cookies: {{savedCookies}}
- Open Page: https://example.com/dashboard
- You're already logged in!
Example 3: Test Without Cookies
Clear cookies to test logged-out behavior
Workflow sequence:
- Clear Cookies
- Open Page: https://example.com/protected
- Assert redirect to login page
Cookie Authentication Pattern
A common pattern is to login once and save the cookies, then reuse them in subsequent runs:
First Run (Login & Save):
- Open login page
- Enter credentials
- Submit login
- Get Cookies
- Save cookies to Google Sheets or file
Subsequent Runs (Reuse Cookies):
- Load cookies from storage
- Add Cookies
- Go directly to authenticated pages
Best Practices
Set Cookie Domain Correctly
When adding cookies, ensure the domain matches where they'll be used. Cookies for api.example.com won't work on www.example.com.
Handle Cookie Expiry
Session cookies expire when the browser closes. Check cookie expiry dates and refresh authentication if cookies have expired.
Security Warning
Cookies contain sensitive authentication data. Store them securely and never commit them to version control.