Sessions
22. Oct, 2021Pirsch has the option to keep sessions alive. We do not recommend using this feature for regular websites, but it can be handy for mobile apps, single-page applications, and other types of software where you have long-running sessions. Otherwise, a session will only be kept alive if you send a page view, which is usually the desired behavior.
Extending a session prevents creating unnesseccary page views.
Extending Sessions Using the API
Sessions can be extended by sending a simple request to the API.
|
|
The data must be identical to the data used when sending a regular page view.
Extending Sessions Using Javascript
It’s possible to extend a session from the browser, without adding anything. Here is a snippet keeping the session alive. It calls the session endpoint once a minute to make sure it’s kept alive.
|
|