account-sdk-browser icon indicating copy to clipboard operation
account-sdk-browser copied to clipboard

Detect changes in login status based on cookies

Open zamzterz opened this issue 5 years ago • 0 comments

Currently the hasSession call caches all results using a common key (hasSession-cache) in browser session storage. If the session state reflected in cookies changes it might not be detected until the cache expires.

To detect such changes in cookie state the hasSession result cache key could depend on the session cookie value, for example:

  • key: hasSession-cache for not logged-in user
  • key: hasSession-cache-<cookie value> for logged-in user

zamzterz avatar Oct 19 '20 09:10 zamzterz