Can user disable html5 sessionStorage?

后端 未结 3 1860
Happy的楠姐
Happy的楠姐 2020-12-10 12:19

can user disable the HTML5 sessionStorage just how he can disable cookies?

Also is sessionStorage will valid till page refresh? I mean what session actually mean, is

3条回答
  •  佛祖请我去吃肉
    2020-12-10 12:45

    sessionStorage is used for session-based data. It is erased when the tab is closed according to the standard. You should use localStorage to persist across tab/window closings. Of course browsers can always not support these features or disable them, so you should handle that edge case to ensure your site remains functional. The best way to do this is to revert back to using cookies or use a compatibility library like this one.

提交回复
热议问题