# How long does a session last?

> A session lasts 30 minutes by default. Set expires_in from 60 to 86,400 seconds (24 hours) when you create it, and see what happens when it expires.

Source: https://esigncomply.com/docs/kb/how-long-does-a-session-last

Last updated November 25, 2026

A session lasts 30 minutes by default. Set `expires_in` on `POST /v1/sessions` to any whole number of seconds from 60 to 86,400, which is 24 hours. Esign Comply expires the client token at the same moment. After that, browser calls on the session return `401 client_token_expired` and you create a new session.

## How do I set a different session lifetime?

Send `expires_in`, in seconds, when you create the session. The default is 1,800 seconds. A value under 60 or over 86,400 returns `400` [`invalid_request`](https://esigncomply.com/docs/api/errors.md#invalid_request) with `param: "expires_in"`. The response carries `expires_at`, the exact time the session ends.

```bash
curl https://esigncomply.com/v1/sessions \
  -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: signup-user_7c1d-1" \
  -d '{
    "profile": "prof_signup_4f1a",
    "signer": { "external_id": "user_7c1d" },
    "documents": [{ "document": "doc_8Hq2", "version": "current" }],
    "context": { "url": "http://localhost:3000/signup" },
    "expires_in": 3600
  }'
```

## What happens when a session expires?

The session moves to `expired`, which is a final state, and the `session.expired` webhook is sent. Events and completion sent with the client token return `401` [`client_token_expired`](https://esigncomply.com/docs/api/errors.md#client_token_expired). No record is written, so an expired session is not a signature event. A job expires overdue sessions every minute, and reading one with `GET /v1/sessions/{id}` marks it expired at once.

## Can I extend a session that is already running?

No. `expires_at` is fixed when the session is created, and no call changes it. For a signer who needs longer, create the session with a longer `expires_in`, up to 86,400 seconds.

## How do I start again after a session expired?

Create a new session on your server and attach the browser SDK with the new `client_token`. Use a new `Idempotency-Key`: the old key replays the response of the expired session. Create the session when the form is shown, not when the page first loads in a background tab.

## Related

- [Session states](https://esigncomply.com/docs/api/sessions.md#session-states)
- [Create a session](https://esigncomply.com/docs/api/sessions/create-a-session.md): the `expires_in` field.
- [Session client tokens](https://esigncomply.com/docs/api.md#session-client-tokens)
- [How long is an Idempotency-Key kept?](https://esigncomply.com/docs/kb/how-long-is-an-idempotency-key-kept.md)
