All Articles/Sessions

Understanding Session Tracking

Learn how Lognitor tracks user sessions across your application.


What Is a Session?

A session represents a single user's interaction with your application — from the moment they arrive until they leave or go inactive. Lognitor groups all logs, errors, and requests from a session into a timeline.

Enabling Session Tracking

Browser SDK

Session tracking is enabled by default:

JavaScript
Lognitor.init({
  apiKey: 'your-key',
  sessionTracking: true, // default
});

The SDK auto-generates a unique session ID per browser tab.

Server-Side SDKs

For server-side tracking, set the session ID manually:

JavaScript
Lognitor.setSession('sess_abc123');

Or pass it per-log:

JavaScript
Lognitor.info('Request processed', {
  session_id: req.sessionId,
});

What Sessions Show

In the Sessions page, each session displays:

  • Session ID and user (if set)
  • Duration and event count
  • Error count
  • Start time

Click a session to see the full timeline of events in chronological order.