The maximum session duration is 6 hours. When a session times out, you’ll see a
TimeoutError: Timeout _____ms exceeded.Project-wide timeout
You can change the default session timeout for all sessions in your project through the dashboard settings.

Per-session timeout
Settimeout in the HTTP request body, or api_timeout in the Node.js and Python SDKs, to specify the session duration in seconds. The SDK request option timeout controls how long the client waits for an API response; it does not set the browser session duration.
This is useful when different sessions need different timeouts, or when you need more granular control than the dashboard toggle provides.
The examples below set timeout to 3600 seconds (1 hour), overriding the project default. Unless explicitly closed beforehand, the session continues running for an hour before terminating. At disconnect, it ends.
- Node.js
- Python
Timeouts and keep alive
Setting a custom timeout extends how long a session can run, but the session still terminates when you disconnect. If you need to disconnect and reconnect to the same session, use Keep Alive instead. For sessions that need both extended duration and reconnection support, configure both options:Node.js
Keep alive
Learn how to keep sessions alive across disconnects.
Manage browser sessions
Monitor session state and release browsers when work finishes.