flagon-useralejs
flagon-useralejs copied to clipboard
Explore Local Storage SessionID Solution for Multi-Tab Applications
Currently, userale will assign a new sessionID unless it detects an existing sessionID stored in 'session storage". New pages (tabs) spawned from the current page is in the same browsing context, and will have access to sessionStorage. However, sessionStorage doesn't persist across different browsing contexts. Meaning if user opened new tab, then navigated to same application or page a new sessionID would be assigned. These two sessions should be the same (unless there is some edge case I'm not thinking about).
Option 1: pass sessionID into sessionStorage, detect new browser, push sessionStorage to localStorage, emit payload to grab (e.g., sessionID: $value), grab payload.
Option 2: Broadcast API (safari, IE support)?
Good article here, but dated: https://blog.guya.net/2015/06/12/sharing-sessionstorage-between-tabs-for-secure-multi-tab-authentication/#:~:text=Right%2C%20sessionStorage%20is%20not%20shared%20across%20tabs.&text=The%20way%20I%20solved%20it,have%20the%20sessionStorage%20for%20us.&text=Click%20to%20%E2%80%9CSet%20the%20sessionStorage,see%20the%20sessionStorage%20is%20shared.
@poorejc can this issue be closed with this PR? A bit of a different approach, but I think it solves the same problem. https://github.com/apache/flagon-useralejs/pull/412
Closing as completed.