The default session
If you run any command without--session, GSD Browser uses a single shared default session. This is fine for simple scripting and one-off tasks. For anything that requires isolation — multiple agents running concurrently, different user accounts, or separate test environments — use named sessions.
Targeting a named session
Add--session <name> to any command to route it to that session’s daemon instance:
Daemon management per session
Each named session runs its own daemon. Use thedaemon subcommands with --session to manage a specific session’s daemon:
Daemon lifecycle and idle shutdown
Each session’s daemon is long-lived but not permanent. To keep idle sessions from holding Chrome processes open forever, the daemon automatically exits when it has been idle for a configurable window, and the next CLI or MCP request transparently starts a fresh one.Idle shutdown
The daemon tracks the time since the last IPC request it handled. After the configured idle window passes with no in-flight requests, it shuts down gracefully through the same path asdaemon stop — cleaning up the browser, marking the session manifest as stopped, and releasing the IPC endpoint. The next command on that session auto-starts a new daemon, so the behavior is invisible to scripts and agents.
Configure the window with GSD_BROWSER_IDLE_SHUTDOWN_SECONDS:
env block of your MCP client configuration. The daemon reads it once at startup.
Auto-restart on version mismatch
When you upgrade gsd-browser, the running daemon for a session may still be the previous version. On the next request, the CLI compares its own version against the version recorded in the session manifest. If they differ, the CLI stops the live daemon and starts a new one built from the current binary before forwarding the request. No manualdaemon restart is required after an upgrade.
Saving and restoring browser state
Persist the full browser state — cookies, local storage, session storage — to disk so it can be restored later. This is the recommended way to preserve authenticated states across daemon restarts.What sessions scope
Named sessions are more than just browser profiles. Several GSD Browser subsystems use the session name as a namespace:
This means the action cache learned from a
checkout session does not bleed into a dashboard session, and vault credentials stored for checkout are not accessible to dashboard.
Common patterns
- Persistent auth
- Parallel agents
- Clean test scenarios
Log in once, save the session state, then restore it on every future run to skip the login flow:
Sessions in MCP
When using the MCP server, pass the session name in the serverargs or as an environment variable so every tool call is automatically routed to the right session:
