Sessions and auth attempts
What a session and an authentication attempt are, and how long a session lasts.
An authentication attempt is a short-lived state machine for one sign-in. It issues challenges, which are requests to prove a factor such as a password. It verifies the proofs. Then it hands off a completed result, the handoff token, which the app exchanges for a session.
A session is the durable container after sign-in. It carries the verified user and factors once an authentication attempt succeeds.
The generated OpenAPI reference exposes these resources as endpoint groups (Authentication attempts, Sessions). The SDK middleware reads the session cookie and validates its token to protect routes and expose auth state to framework code (see SDK proxy).
Session lifetime
A completed sign-in gives the session a lifetime of 24 hours. The lifetime starts at sign-in, and using the session does not extend it. When it runs out, the session cookie stops working, GET /sessions/me answers 401, and the user signs in again.
A sign-in can ask for a different lifetime with the ttl field of POST /sessions/exchange (see Sessions), up to the server's maximum of 30 days. On a server you run yourself, session.default_ttl sets the default and session.max_ttl the maximum (see the configuration guide).
An anonymous session, which a client can create before anyone signs in, lasts 10 minutes. When a sign-in completes on it, it gets the full lifetime.
Was this helpful?