Session Management
Sessions tie together pageviews, events, and identifies for a single visitor. Pulsora keeps session management simple, lightweight, and cookie-free.
How Sessions Work
- A new session ID (
uuidv4) is generated the first time a visitor loads your site. - The ID is stored in-memory—no cookies,
localStorage, or indexed DB. - As long as the tab remains open, all events share the same session.
- Closing the tab or calling
pulsora.reset()generates a fresh session.
Because sessions are ephemeral, Pulsora automatically links them to the stable browser fingerprint so attribution remains accurate.
Accessing Session IDs
Use the getSessionId() helper whenever you need to forward a session to your backend or payment processor:
import { Pulsora } from '@pulsora/core';
const pulsora = new Pulsora();
pulsora.init({ apiToken: 'pub_123' });
const sessionId = pulsora.getSessionId(); // e.g. "c8df4c3c-..."
Session IDs are safe to expose—they are random, anonymous identifiers.
Session Duration & Timeouts
Pulsora tracks session duration from initialization and sends it with revenue events. Sessions automatically expire after 30 minutes of inactivity. The backend enforces this rolling 30-minute inactivity window when aggregating analytics.
After expiration, the next pageview will start a new session with a new session ID.
Best Practices
- Forward fingerprints + session IDs with payment metadata for revenue attribution.
- Do not persist sessions yourself; let Pulsora manage them to maintain privacy guarantees.
- Call
reset()after logout to prevent cross-user attribution on shared devices. - Avoid calling
reset()on every route change—that breaks user journeys and funnels.
Continue with our SPA guide to see how sessions behave during single-page navigation: SPA Support →