Session resumption
How reconnect with Resume-Id works and when previous session state can be restored.
Session resumption allows a client to reconnect and continue the same logical
session after connection loss.
Core idea
When resumption succeeds, server restores the session state from before the disconnect, including initialization/auth context and packet-processing continuity.
How it works
- On connection accept, server includes
Resume-Idin response headers. - Client stores this
Resume-Id. - On reconnect, client sends the same
Resume-Idrequest header. - If resume is valid, server restores previous session state instead of creating a fresh one.
What the client should do
- Persist latest
Resume-Idper active session. - Reuse it only for reconnecting that same session.
- After reconnect, re-send packets that were not acknowledged by your client. Server preserves packet continuity and avoids duplicate business execution for already-processed unacknowledged packet IDs.
When resumption is possible
- Connection was interrupted by client/network side (for example: internet drop, app restart, device sleep, local process crash).
- Reconnect happens before resume state expires.
- Provided
Resume-Idis valid.
When resumption is not possible
Resumption is not available when disconnect was initiated by server.
Example: server closes session with 4101 (application paused). In this case,
client must start a new session lifecycle (new connect + initialize + authorize
flow when allowed).
Resume-related close codes
| Close code | Error | Meaning |
|---|---|---|
4400 | failed to resume session | Resume attempt failed due to server-side resume processing error. |
4401 | resume ID was not found or it is expired | Resume-Id is invalid, expired, or no longer available for restore. |