Glossary

Session Token

Proof that you already logged in. After authentication the server hands the client a token; every later request carries it, and its lifetime, storage and revocation determine how safe the session is.

General definition

Session Token is the generic name for the value a client presents to show that it has already authenticated. Authentication proves who you are once; the session token carries that result forward so the user is not asked for a password on every request. There are two designs. An opaque token is a long random string that means nothing by itself; the server looks it up in a session store to find the user and session state. A signed or self-contained token, usually a JSON Web Token, carries the user ID, expiry and other claims and is verified by signature, so any service with the key can accept it without a shared store.

How the token travels matters as much as its format:

  • Cookies: set by the server with HttpOnly (not readable by JavaScript), Secure (HTTPS only) and SameSite attributes; the browser attaches them automatically, which is convenient for web apps but is also what cross-site request forgery exploits
  • Bearer tokens: sent in an Authorization: Bearer header by the application; standard for mobile apps, SDKs and APIs, where the app is responsible for storing the token safely

The OWASP session management guidance and the OAuth 2.0 framework (RFC 6749) converge on the same lifecycle controls. Tokens should be unpredictable and generated after login, not before, to defeat session fixation. They should expire: short-lived tokens of minutes to an hour limit the damage of theft. A longer-lived refresh token, stored more carefully and ideally rotated on each use, obtains new short-lived tokens without another password prompt. Rotation should also happen on privilege change, and revocation needs a server-side mechanism: a session store entry to delete, a denylist, or an expiry short enough that revocation means not issuing the next token. Logging out should invalidate the server side, not only forget the token on the device.

Self-contained tokens trade revocation for scale: they cannot be recalled before expiry unless a denylist is checked, which is why short expiry plus refresh is the usual pattern, and why the signing key itself needs key rotation.

Need full control of the stack? Ethora runs as a self-hosted chat server on premise, in your own cloud or from AWS Marketplace.

In the Ethora ecosystem

Ethora uses short-lived JWT chat tokens for end users. When your backend provisions a user through the Ethora API, or a user signs in through social sign-on, the SDK receives a token that identifies the user and the App and expires after a short period. The chat SDK presents it as a bearer token to the API and uses it to authenticate the XMPP connection, so there is no separate chat password. Renewal runs through the host backend: your server, which holds the app-level API token, requests a fresh chat token for the user, so your own session policy (your identity provider, your PKCE sign-in, your logout) decides whether the chat session continues.

On devices the React Native SDK stores credentials in the platform Keychain or Keystore and keeps the local message cache encrypted at rest with AES-256, so a token on a lost phone is protected by the device lock. The app-level API token stays server-side and is never shipped in a mobile or web build.

Get started

Run chat and AI on servers you control

An open-source chat server on premise, in your own cloud or from AWS Marketplace, with an enterprise SLA.

Free tier available Enterprise SLA No vendor lock-in