Skip to main content

Get Cookies

Retrieves all cookies from the current browser session as an array of cookie objects.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing the node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If Continue On Error property is true, no error is caught when the project is executed, even if the Catch node is used.

Input

  • Browser ID - The browser session identifier from the Open Browser node.

Output

  • Cookies - Array of cookie objects from the current page. Each object contains properties like name, value, domain, path, expires, httpOnly, and secure.

Examples

Get All Cookies

Browser ID: {{browser_id}}
Output: {{cookies}}

Result: [
{
"name": "session_id",
"value": "abc123",
"domain": ".example.com",
"path": "/",
"expires": 1735689600,
"httpOnly": true,
"secure": true
},
...
]
1. Get Cookies node:
Browser ID: {{browser_id}}
Output: {{all_cookies}}

2. For Each {{all_cookies}} as {{cookie}}:
If {{cookie.name}} equals "auth_token":
Store {{cookie.value}} as {{auth_value}}

Save Cookies to File

1. Get Cookies node:
Browser ID: {{browser_id}}
Output: {{cookies}}

2. Write File:
Path: C:\cookies\session.json
Content: {{cookies}}

Restore Session with Cookies

1. Read File:
Path: C:\cookies\session.json
Output: {{saved_cookies}}

2. For Each {{saved_cookies}} as {{cookie}}:
Set Cookie node:
Browser ID: {{browser_id}}
Cookie Name: {{cookie.name}}
Cookie Value: {{cookie.value}}
Expires: {{cookie.expires}}

Each cookie object contains:

  • name - Cookie name
  • value - Cookie value
  • domain - Domain the cookie belongs to
  • path - Path scope of the cookie
  • expires - Expiration timestamp (Unix time)
  • httpOnly - Whether accessible only via HTTP
  • secure - Whether sent only over HTTPS
  • sameSite - SameSite attribute (Strict, Lax, None)

Tips

  • Use to save and restore browser sessions
  • Helpful for debugging authentication issues
  • Cookies are domain-specific
  • Session cookies may not have an expires property
  • Use to transfer sessions between automation runs
  • Store cookies securely if they contain sensitive data

Common Errors

  • "Browser ID cannot be empty" - Connect to an Open Browser node
  • "Browser session not found" - Ensure the Open Browser node has run successfully