google-chrome - 当用户离开时,IE 11(Edge) 上的 sessionStorage 被清除

标签 google-chrome internet-explorer firefox frontend sessionstorage

sessionStorage has been documented as it clears when the tab closes的行为.但是,在我的实践中,当用户在选项卡中导航离开时,我客户公司中的 IE 11(Edge) 会清除 sessionStorage(是的,同一个选项卡仍处于打开状态)。

使用 firefox 和 chrome,我的网络应用程序的用户可以自由地导航离开和导航回来,并且 session 存储中的数据被保留。但是对于 IE 11(Edge),我的用户不能这样做。

我在 session storage 上查看了 Microsoft 的页面它写道:

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)



我的问题是:

这是 IE session 存储的常见行为吗?如果用户离开您的域, session 存储将被清除,而其他浏览器坚持关闭浏览器选项卡。

谢谢

最佳答案

这可能与 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.

关于google-chrome - 当用户离开时,IE 11(Edge) 上的 sessionStorage 被清除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50355029/

相关文章:

javascript - InnerHTML 更改适用于 Firefox,但不适用于 IE 9

css - Firefox 和 Internet Explorer 中下拉菜单的 UI 问题

firefox - 如何阻止 Firebug 在脚本错误时中断?

javascript - Firefox 选择文本范围

javascript - 滚动效果不适用于 chrome

javascript - console.dir 和 console.log 有什么区别?

google-chrome - 从 URL 打开 Chrome VNC 查看器

jquery - IE 中的透明选择/选项文本

javascript - 使用 javascript/css 将 64 位字符串转换为 jpeg

IE8、Chrome、Firefox 和 Safari 之间的 CSS 兼容性