简体   繁体   English

sessionStorage数据存储在哪里?

[英]Where is sessionStorage data stored?

When sessionStorage.setItem("number",2) is executed, where does number gets stored? 执行sessionStorage.setItem(“ number”,2)时,数字存储在哪里? Is it in the local browser or the server where application is hosted? 是在本地浏览器还是托管应用程序的服务器中? Please mention the path/file for Chrome browser, if it is local. 如果是本地浏览器,请提及Chrome浏览器的路径/文件。

The values are stored by browser in the user's computer. 这些值由浏览器存储在用户计算机中。 You can test it in eg chrome console. 您可以在chrome控制台中对其进行测试。 To read value use 读取价值使用

sessionStorage.getItem("number");

It's not stored on the server, since we're still in client side when you're talking about Window.sessionStorage . 它没有存储在服务器上,因为当您谈论Window.sessionStorage时,我们仍然在客户端。 It's stored in a file called "sessionstore.jsonlz4". 它存储在一个名为“ sessionstore.jsonlz4”的文件中。 In any case, this question has an answer here . 无论如何,这个问题在这里都有答案。

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

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