Skip to main content

Set Cookie

Sets a cookie in the browser session with configurable name, value, expiration, and security options.

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.
  • Cookie Name - Name of the cookie to set.
  • Cookie Value - Value to set for the cookie.
  • Expires - Cookie expiration time in seconds. Use 0 for session cookies (default).

Options

  • Http Only - Make cookie accessible only via HTTP, not JavaScript. Default is false.
  • Secure - Send cookie only over HTTPS connections. Default is false.

Examples

Browser ID: {{browser_id}}
Cookie Name: session_id
Cookie Value: abc123xyz789
Expires: 0
Browser ID: {{browser_id}}
Cookie Name: user_preference
Cookie Value: dark_mode
Expires: 2592000

(Expires in 30 days: 30 * 24 * 60 * 60 = 2592000 seconds)

Browser ID: {{browser_id}}
Cookie Name: auth_token
Cookie Value: {{auth_token}}
Expires: 3600
Http Only: true
Secure: true

Set Multiple Cookies

For each cookie in cookie_list:
Set Cookie node:
Browser ID: {{browser_id}}
Cookie Name: {{cookie.name}}
Cookie Value: {{cookie.value}}
Expires: {{cookie.expires}}
  • 0 - Session cookie (deleted when browser closes)
  • 3600 - 1 hour
  • 86400 - 1 day
  • 604800 - 1 week
  • 2592000 - 30 days
  • 31536000 - 1 year

Tips

  • Cookies must be set for the current domain
  • Use session cookies (expires: 0) for temporary data
  • Enable Secure for authentication cookies on HTTPS sites
  • Enable Http Only to prevent JavaScript access (security best practice)
  • Use Get Cookies to verify the cookie was set
  • Refresh the page after setting cookies for them to take effect in some cases

Common Errors

  • "Browser ID cannot be empty" - Connect to an Open Browser node
  • "Cookie Name cannot be empty" - Provide a name for the cookie
  • "Cookie Value cannot be empty" - Provide a value for the cookie
  • "Failed to set cookie" - Ensure you are on the correct domain. Cookies can only be set for the current domain
  • "Browser session not found" - Ensure the Open Browser node has run successfully