-
Notifications
You must be signed in to change notification settings - Fork 77
Session and party identifiers don't time out within a page-view even if they should #163
Comments
If there is a good reason for this issue to not be a bug, please explain why ? |
Looks like a bug. The session timeout is used to set the expiration on the session cookie. If the page stays open, but idle for the duration of the session timeout, the in-memory session ID that the script holds is not invalidated. The same holds for the Perhaps the safest way of checking for expiry is to re-parse the document cookies on each signal invocation. This would also be robust against a user deleting their cookies mid-session. This extends to the party ID and other information stored in cookies. |
Thanks Friso for your quick feedback. Now considering the partyId, the doc says it is identifying a client; i-e smth common to set of distinct client sessions. |
@jerome73 A party ID is a long lived cookie. It is the same for each tab in a normal browser instance. Getting a new cookie for each tab implies some kind of private mode or blocking of known trackers or otherwise. |
Ok. |
This is indeed a bug. The issue is that we only time out session or party identifiers at the start of a page view. While a page view is underway we never expire either, even if the page view exceeds the party or session timeouts. Fixing this involves some careful thinking:
There are two obvious implementations for this:
My proposal is:
Also worth considering but out of scope for this issue would be a formal API to allow the page itself to reset or extend the lifetime of the identifiers. |
Hi Andrew, Thanks for your analysis and proposal. |
Hi Andrew and Friso, |
Hi. |
At the moment I don't think anyone has volunteered to fix it. |
hi guys. please help :) it's walking on my nerv |
Problem Statement
When a session is created and there is no activity (i-e no events/tags generated from the client .js) during a window time beyond the session timeout (default 30 minutes), the session id is not regenerated for the next event while it should be.
I can't see in the code what is done really with this session_timeout so far a part from being taken from the conf if defined there or setup to the default value (30 minutes).
Suggested fix
I would assume that for each call to the signal method, the session timeout should be used to check wether the amount of time, elapsed since the latest event sent and now, is beyond the timeout or not. If the gap is beyond the session timeout, then signal() method should generate a new sessionId and update the cookie accordingly prior to send the event/tag.
The text was updated successfully, but these errors were encountered: