MCPcopy
hub / github.com/browserbase/mcp-server-browserbase / setActiveSessionId

Method setActiveSessionId

src/sessionManager.ts:112–124  ·  view source on GitHub ↗

* Sets the active session ID. * @param id The ID of the session to set as active.

(id: string)

Source from the content-addressed store, hash-verified

110 * @param id The ID of the session to set as active.
111 */
112 setActiveSessionId(id: string): void {
113 if (this.browsers.has(id)) {
114 this.activeSessionId = id;
115 } else if (id === this.defaultSessionId) {
116 // Allow setting to default ID even if session doesn't exist yet
117 // (it will be created on first use via ensureDefaultSessionInternal)
118 this.activeSessionId = id;
119 } else {
120 process.stderr.write(
121 `[SessionManager] WARN - Set active session failed for non-existent ID: ${id}\n`,
122 );
123 }
124 }
125
126 /**
127 * Gets the active session ID.

Callers 5

getSessionMethod · 0.95
cleanupSessionMethod · 0.95
closeAllSessionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected