sessionTimeout

The sessionTimeout property sets how long (in seconds) can pass without a new tracked interaction before the SDK treats the session as expired. The default is 30 minutes (1800 seconds).

Syntax

Assign to sessionTimeout on the shared tracker:

PiwikTracker.sharedInstance()?.sessionTimeout = seconds
[PiwikTracker sharedInstance].sessionTimeout = seconds;

Parameters

  • sessionTimeout number (seconds) - Inactivity window in seconds. When this much time has passed since the last session start timestamp the SDK uses internally, the next queued event is marked as starting a new session. Default: 1800 (30 minutes).

Examples

To set the expiration time to 60 minutes (60*60 seconds):

PiwikTracker.sharedInstance()?.sessionTimeout = 60 * 60
[PiwikTracker sharedInstance].sessionTimeout = 60 * 60;

Notes

  • The Piwik PRO backend can also start a new visit when events are more than about 30 minutes apart; keep client and server expectations aligned when you change this value.

Related methods