Skip to main content
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