Do not set the previous session ID reference in cookies if anonymous tracking is enabled (close #1268) #1274
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #1268
Addresses the issue where the previous session ID reference was updated in the cookies even in case anonymous tracking (with session tracking was enabled).
This was a problem, because the cookie value is sent as an HTTP header along with requests. It allowed one to use a cookie enrichment to inspect the value and use the previous session ID reference to basically reconstruct the user identifier (join together their previous sessions).
To solve the issue, I updated the function that serializes the cookie value to accept a flag whether anonymous tracking is enabled. In case it is enabled, we skip serializing the domain user ID and the previous session ID.