Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sessionStorage on IE 11(Edge) got cleared when user navigate away

The behaviour of sessionStorage has been documented as it clears when the tab closes. However, in my practice, IE 11(Edge) in my client company clears sessionStorage when user navigates away within the tab (yes, the same tab is still open).

With firefox and chrome, my web app's user can freely navigates away and navigates back, and the data in session storage was kept. But with IE 11(Edge), my user cannot do so.

I checked Microsoft's page on session storage and it reads:

The sessionStorage attribute of the window object maintains key/value pairs for all pages loaded during the lifetime of a single tab (for the duration of the top-level browsing context)

My question is:

Is this a common behaviour of IE's session storage? session storage get cleared if the user navigates away from your domain, whereas other browsers stick to the closure of the browser tab.

Thanks

like image 715
chfw Avatar asked May 15 '18 16:05

chfw


1 Answers

This might be related to Zone policies in IE/Edge;

https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13861050/

Session Storage and InPrivate Local Storage is dropped when redirecting across zones. For example, if as a part of your redirection chain you redirect from the intranet to internet, Microsoft Edge will not retrieve the expected session storage data. This issue also exists for local storage in InPrivate mode.

like image 107
nilsel Avatar answered Nov 15 '22 05:11

nilsel