---
title: "Dump the session's cookies and storage"
method: GET
path: "/v1/sessions/{sessionID}/context"
tags: ["Sessions"]
---

# Dump the session's cookies and storage

`GET /v1/sessions/{sessionID}/context`

## Request

- Base URL: `https://api.spicrawl.com`
- URL: `https://api.spicrawl.com/v1/sessions/{sessionID}/context`
- Auth: HTTP bearer

The only endpoint that returns credentials. Works only while the session is `active`. The response is
marked `Cache-Control: no-store, private`. Reading does not slide the TTL.

Pitfalls:
- After release, delete, or TTL expiry the context is purged immediately and permanently. A released
  session answers 410 `ERR::SESSION::RELEASED`; an expired one 410 `ERR::SESSION::EXPIRED`. Do not
  retry a 410: create a new session and log in again.
- Store this object yourself if you need it later. You can POST its `session_context` back to
  `POST /v1/sessions` to clone the session.
- 500 `ERR::SESSION::STATE_CORRUPT` means the stored context cannot be opened (retired key, newer
  schema, corrupt blob). It will not recover; create a new session.

## Response `200`

The live context.

- SessionContextDump: Body of `GET /v1/sessions/{id}/context`. `session_context` can be POSTed back to `POST /v1/sessions` to clone the session.
  - `session_id` string, required: The session id.
  - `schema_version` integer, required: Stored format version. Currently 1.
  - `session_context` SessionContext, required: Everything a browser holds that makes it logged in. Maps and arrays are never null in responses.
    - `cookies` SessionCookie[]: Browser-wide cookie jar. At most 2000.
      - `name` string, required: Cookie name. Required; trimmed.
      - `value` string: Cookie value.
      - `domain` string, required: Cookie domain; a leading dot (".example.com") makes it domain-wide and is preserved. Required.
      - `path` string: Cookie path. Empty becomes `/`.
      - `expires` number: Expiry in seconds since the epoch (CDP units). Omit for a session cookie. Zero or negative values (such as CDP's -1) are treated as a session cookie and omitted.
      - `http_only` boolean: HttpOnly flag.
      - `secure` boolean: Secure flag. Required to be true when `same_site` is `None`.
      - `same_site` 'Strict' | 'Lax' | 'None': SameSite attribute in exact CDP casing. Omit when unset; it is not defaulted. `None` without `secure: true` is refused.
    - `local_storage` object: Origin (bare `http(s)://host[:port]`, no path) to key/value map. At most 100 origins and 1000 keys per origin.
    - `session_storage` object: Same shape and limits as `local_storage`. Many single-page apps keep access tokens here; include it when importing a login.
    - `indexed_db` object: Origin to list of IndexedDB databases, each carried verbatim as JSON. At most 50 origins and 50 databases per origin. Treat as opaque.
  - `fingerprint` object, nullable: Stored browser fingerprint, or null when none. Omitted only in edge cases.
  - `domain_scores` object: Per-domain standing, as stored. `{}` when empty.
  - `retired` 'expired' | 'usage_exhausted' | 'explicit': Why a worker retired the session. Absent while usable.
  - `usage_count` integer, required: Scrapes that used the session.
  - `created_at` string, date-time, required: Creation time.
  - `last_used_at` string, date-time, nullable, required: Last use, or null if never used.
  - `expires_at` string, date-time, required: Current sliding expiry.
  - `warning` string, required: Fixed reminder that this context is destroyed on release, delete or expiry. Save the object now if you need it later.

## Other responses

- `401`: Missing, invalid, revoked or expired key. Not retryable with the same key.
- `403`: The key lacks the scope this route requires (`ERR::AUTH::INSUFFICIENT_SCOPE`), or the action is not permitted.
- `404`: No such resource for this key's organization.
- `410`: The resource existed but is past its retention window or was purged. Not retryable.
- `500`: Internal error. Retryable when `retryable` is true.

---

[API](https://skmtc.dev/spicrawl/apis/spicrawl-api.md) · [All operations](https://skmtc.dev/spicrawl/apis/spicrawl-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spicrawl/apis/spicrawl-api/revisions/c4b4c6f97219?raw)
