admin管理员组文章数量:1302867
sessionStorage
is supposed to be cleared after the browser is restarted, according to MDN:
data stored in sessionStorage gets cleared when the page session ends
I restart and restart Firefox 59 and Chrome 65 — and nothing, sessionStorage
's data is still there. Why would that be?
sessionStorage
is supposed to be cleared after the browser is restarted, according to MDN:
data stored in sessionStorage gets cleared when the page session ends
I restart and restart Firefox 59 and Chrome 65 — and nothing, sessionStorage
's data is still there. Why would that be?
-
3
Like
select
, Firefox and Chrome are not broken. ("Not broken" background: pragprog./the-pragmatic-programmer/extracts/tips). Show us the code that you think is demonstrating that session storage is not getting cleared, and we'll tell you what's wrong with it. (Edit: Just tested to be absolutely sure, and both Chrome and Firefox dropped the values I put in session storage when they were expected to -- of course.) – T.J. Crowder Commented Jan 21, 2018 at 14:41 -
2
Testet in Firefox, using the option "Restore last session" restores
sessionStorage
. – Roland Starke Commented Jan 21, 2018 at 14:56 - 1 @T.J.Crowder :) I bet that this is the problem OP is having :D. (idk i don't use sync, but maybe if you do, your sessions never end) – Roland Starke Commented Jan 21, 2018 at 15:09
-
1
@totalamd: It being visible if you dive into the browser's list of what it has stored is not the same as it not expiring. It's entirely within spec if Firefox doesn't clear that data until you next request it and it says "Oh, this data is obsolete -- we'll throw it out and start fresh." Or if it doesn't even do that. So long as
sessionStorage.getItem("test")
doesn't return"qwe"
when you call it in a fresh session, it's in-spec. So again: Post the code that you think demonstrates the problem. – T.J. Crowder Commented Jan 21, 2018 at 16:23 -
1
@T.J.Crowder Created new Firefox profile, turned out show tabs&windows from last time saves
sessionStorage
. – TotalAMD Commented Jan 21, 2018 at 22:41
1 Answer
Reset to default 11For those who are wondering and here. If user has selected to continue where he left option of similar feature in any browser. sessionStorage
will be saved by the browser in between the restarts of the browser.
We had to get our requirements changed as because of this. Hope it will be helpful for some
本文标签: javascriptsessionStorage doesn39t clear after browser restartStack Overflow
版权声明:本文标题:javascript - sessionStorage doesn't clear after browser restart - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741690850a2392712.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论