schibsted / account-sdk-browser

Schibsted Account SDK for browsers
https://schibsted.github.io/account-sdk-browser/
MIT License
16 stars 11 forks source link

feat: add tabId to refresh-itp-cookies #274

Closed michal-oleniacz-stp closed 7 months ago

michal-oleniacz-stp commented 7 months ago

This PR adds a simple mechanism for creating tab-scoped IDs that are persistent after redirects.

Flow goes as follows: page-load -> generate ID -> try to store ID in session storage if it's not present already -> session flow -> redirect -> read ID from session storage

We need this in order to debug a race condition bug causing logouts. Tested locally using PRE env so logs confirm it works.