简体   繁体   English

window.sessionStorage 物理存储在哪里?

[英]Where is window.sessionStorage physically stored?

The new html5 specs have a window.sessionStorage and window.localStorage .新的 html5 规格有window.sessionStoragewindow.localStorage Is the window.sessionStorage persisted to disk or is it just in the browser app's memory for the time it is open? window.sessionStorage是保存到磁盘还是在打开时仅在浏览器应用程序的 memory 中?

Thanks谢谢

localStorage and sessionStorage both extend Storage. localStorage和sessionStorage都扩展了存储。 There is no difference between them except for the intended "non-persistence" of sessionStorage. 除了sessionStorage的预期“非持久性”之外,它们之间没有任何区别。

That is, the data stored in localStorage persists until explicitly deleted. 也就是说,存储在localStorage中的数据将一直保留到明确删除为止。 Changes made are saved and available for all current and future visits to the site. 所做的更改将被保存,并可供当前和将来对该站点的所有访问。

For sessionStorage, changes are only available per window (or tab in browsers like Chrome and Firefox). 对于sessionStorage,更改仅适用于每个窗口(或Chrome和Firefox等浏览器中的选项卡)。 Changes made are saved and available for the current page, as well as future visits to the site on the same window. 所做的更改将被保存,并且可用于当前页面以及将来在同一窗口上访问该站点。 Once the window is closed, the storage is deleted. 关闭窗口后,将删除存储。

refer this SO Link 参考此链接

Please refer to these links where local storage/session storage is explained in detail.请参阅这些链接,其中详细说明了本地存储/会话存储。

HTML5 Local storage vs. Session storage HTML5 本地存储与 Session 存储

https://blog.devgenius.io/all-about-localstorage-in-js-4760dbff0b0d https://blog.devgenius.io/all-about-localstorage-in-js-4760dbff0b0d

https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API https://developer.mozilla.org/zh-CN/docs/Web/API/Web_Storage_API

In browsers that are Chromium(Chrome) based, the data is saved in a SQLite file in the subfolder having the location of /AppData/Local/Google/Chrome/UserData/Default/Local Storage.在基于 Chromium(Chrome) 的浏览器中,数据保存在子文件夹中的 SQLite 文件中,该文件的位置为 /AppData/Local/Google/Chrome/UserData/Default/Local Storage。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM