Session Management
Create and destroy persistent browser sessions that retain cookies and browser state so you avoid repeated setup on every request.
Create and destroy persistent browser sessions that retain cookies and browser state, reducing repeated setup and overhead for subsequent requests.
sessions.create
This launches a new browser instance that retains cookies until you destroy it with sessions.destroy. Use sessions when you want to reuse cookies and browser state across requests and skip the overhead of spinning up a new browser each time. For the full parameter list (proxy, browser, device, OS), see sessions.create; for state that persists across many requests, see Profiles.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
cmd |
string | Yes | Must be sessions.create. |
session |
string | Yes | A unique identifier for the browser session to create. |
Request
sessions.destroy
This properly shuts down a browser instance. When you no longer need a session, close it to free resources.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
cmd |
string | Yes | Must be sessions.destroy. |
session |
string | Yes | The identifier of the browser session to destroy. |
Request
Related concepts
Go deeper in the Scrappey knowledge base:
- Stateful web scraping β reusing cookies and state across requests
- Session cookie β the cookie that ties a session together