WebUplink
Guides

Sessions

Manage browser sessions for multi-step workflows with WebUplink.

Sessions

Sessions are persistent browser contexts that let your agent navigate multi-page workflows.

Creating a Session

A new session is created automatically when you browse a URL:

const page = await client.browse('https://amazon.com');
const sessionId = page.session_id; // Use for all follow-up calls

Multi-Step Workflow

// Step 1: Open search
const search = await client.browse('https://amazon.com');

// Step 2: Search for products
const results = await client.browse({
  session_id: search.session_id,
  tool: 'search_products',
  params: { query: 'mechanical keyboard' },
});

// Step 3: Select a product
const product = await client.browse({
  session_id: search.session_id,
  tool: 'select_product',
  params: { index: 0 },
});

// Step 4: Clean up
await client.closeSession(search.session_id);

Session Timeouts

TimeoutDurationBehavior
Idle2 minutesAuto-expires after no requests
Hard cap15 minutesAuto-expires regardless of activity

Concurrent Sessions

An agent can hold multiple sessions simultaneously:

// Two independent browser sessions
const github = await client.browse('https://github.com');
const docs = await client.browse('https://docs.example.com');

// Each has its own cookies, auth state, and history

Closing Sessions

Always close sessions when done to free browser resources:

await client.closeSession(sessionId);

Sessions auto-expire on idle timeout, but explicit cleanup releases resources immediately and is especially important during batch workflows.

On this page