Session
A Session is a stateful browser environment where AI agents execute tasks. Sessions maintain browser state, cookies, and context between multiple tasks.
What is a Session?
A persistent browser instance that:
- Executes multiple tasks sequentially
- Maintains login state between tasks
- Preserves cookies and browser state
- Provides real-time viewing via live URL
Key Properties
id
: Unique session identifierstatus
:"active"
or"stopped"
liveUrl
: Real-time browser viewing URLtasks
: All tasks executed in this sessionprofileId
: Profile for browser configuration (optional)
Creating and Managing Sessions
Usage Patterns
Auto-Session (Implicit)
✅ Simple ❌ No state preservation
Custom Session (Explicit)
✅ State preservation ✅ Multi-step workflows ❌ Manual cleanup
State Management
What’s Preserved:
- Authentication cookies and tokens
- Local storage and session data
- Browser history and form data
- Downloaded resources and cache
Profile Inheritance:
Real-Time Monitoring
Agent Session vs Browser Session
Browser Session (Standalone): Direct Chrome DevTools Protocol access for custom automation Agent Session (AI-Powered): AI agent environment for natural language task execution
These are separate products serving different use cases.
Best Practices
Use Auto-Session for: Simple tasks, no login, proof of concepts Use Custom Sessions for: Multi-step workflows, authentication, production apps
Session Management:
- Always stop sessions when done
- Use profiles to reduce setup time
- Don’t share live URLs publicly
- Clean up sessions with sensitive data