Sessions
What a session is, how long it lasts, and how to read its ID.
What a session is
Every log carries a sessionId, a random ID the SDK creates for the page. You don’t configure it. Every Apperio logger on the same page shares the same session.
How long a session lasts
The ID lives in memory only. The SDK uses no cookies, local storage or session storage, so it has nowhere to keep the ID across page loads:
| What the visitor does | Session |
|---|---|
| Moves between routes in a single-page app | Same session |
| Reloads the page, or follows a link that loads a new page | New session |
| Opens the site in another tab | New session |
So one person browsing a site where each link loads a new page produces several sessions. Session counts read higher, and each session shorter, than a visitor-based count would. This is a known limit of the current version.
What uses it
- The Sessions page, which groups logs by session.
- Sessions affected on each issue. See Errors and issues.
- Session replay, which matches each recording to the logs from the same session.
Reading the session ID
To connect Apperio sessions with your own analytics or support tools, read the ID:
import { getSessionId } from 'apperio';
const sessionId = getSessionId(); // the same value every log on this page carries