Overview
Session snapshots preserve authentication state, allowing you to maintain logged-in sessions across multiple agent sessions without re-authenticating.How Authentication is Preserved
Authentication state is preserved through snapshots in several ways:Browser Cookies
All cookies stored in browser profile
Preserved in filesystem snapshots
Preserved in filesystem snapshots
Web Storage
localStorage and sessionStorage
Preserved in browser profile
Preserved in browser profile
Browser State
Logged-in sessions
Authentication tokens
Session data
Authentication tokens
Session data
Best Practices
1. Use Filesystem Snapshots
For authentication-critical applications, always usesave_snapshot_mode=filesystem:
- JavaScript
- Python
- HTTPie
2. Save After Login
Save snapshots immediately after successful authentication:- JavaScript
- Python
- HTTPie
3. Update Regularly
Refresh snapshots periodically to update authentication tokens before they expire:- JavaScript
- Python
- HTTPie
4. Multiple Environments
Maintain separate environments for different authentication contexts:- JavaScript
- Python
- HTTPie
Authentication State Lifecycle
Troubleshooting
Authentication Not Preserved
If authentication is not preserved, check these common issues:Check Snapshot Mode
Check Snapshot Mode
Ensure you’re using
filesystem mode, not memory or none:- Verify
Verify Default Environment
Verify Default Environment
Confirm the environment is set as default:
- Verify
Token Expiration
Token Expiration
Some authentication tokens expire. You may need to re-authenticate periodically:
- Check & Refresh
Cookie Domain
Cookie Domain
Complete Example
Complete workflow for authentication management:- JavaScript
- Python
- HTTPie