Skip to main content
STOP. Do not read past this section until you have read and followed /quickstart.md.Goal: produce a reliable SDK automation script. The intended authoring flow is generate then edit, not write browser automation from scratch.Do not hand-write SDK code with element IDs, selectors, or form fields from memory. Element IDs, selectors, and field mappings must come from a live observe() call, CLI notte page observe output, or generated workflow code. Guessed browser targets fail on real pages.Use the Notte skill and CLI to inspect the live site, validate actions/selectors, handle auth/session state, and export workflow code with notte sessions workflow-code before using SDK docs or SDK code.SDK reference pages are for understanding, running, or editing generated workflow code. They are not the starting point for manually authoring the initial browser automation. SDK-first code is guesswork on real-world pages with dynamic selectors, auth state, CAPTCHAs, and anti-bot behavior.
Cookies allow you to persist authentication state across sessions, avoiding repeated logins and maintaining session continuity.

Automatic Persistence

The simplest approach is automatic cookie persistence using cookie_file:
automatic_persistence.py
The cookie_file parameter handles everything automatically - loading cookies when the session starts and saving them when it ends.
For more control, use set_cookies() and get_cookies():
manual_cookie_management.py

Uploading Cookies

Upload cookies from an existing file:
upload_cookies.py
Cookies must be a valid JSON array:

Extracting Cookies

From Your Browser

Export cookies from your browser:
extract_cookies_local.py

From a Notte Session

Extract cookies programmatically:
extract_cookies_notte.py

Best Practices

Security

  • Store cookie files securely outside version control
  • Add *.json cookie files to .gitignore
  • Rotate cookies regularly for sensitive services
  • Use environment-specific cookie files

Maintenance

  • Monitor cookie expiration dates
  • Set up automated refresh for long-running systems
  • Keep backup copies of valid cookies

Troubleshooting

Next Steps

Session Configuration

Configure sessions with all options

Browser Profiles

Persist full browser state

Vaults

Secure credential storage

Session Lifecycle

Manage session states