服务器或客户端上是否存在HTML5 sessionStorage? [英] Does HTML5 sessionStorage exist on the server or client?

查看:57
本文介绍了服务器或客户端上是否存在HTML5 sessionStorage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我在MSFT上的HTML5演示中,他们指出HTML5 sessionStorage存储在服务器上,而localStorage存储在客户端上.有人可以澄清sessionStorage在浏览器中使用还是在服务器上是否持久化?如果将其存储在服务器上,则使用什么机制来持久化它?

I was at an HTML5 presentation at MSFT yesterday and they indicated that HTML5 sessionStorage is stored on the server and localStorage was stored on the client. Can someone clarify if sessionStorage is persisted during its use on the browser or it is on the server? If it is stored on the server, what mechanism is used to persist it?

如果将其存储在服务器上,在我看来,客户端上对sessionStorage数据的每次引用都会引起网络流量.如果它存储在客户端上,并且设备处于脱机状态(例如由于连接断开),它是否可用?

If it is stored on the server, it seems to me that each reference to sessionStorage data on the client would cause network traffic. If it is stored on the client, is it available if the device is offline (say due to a dropped connection)?

我想知道sessionStorage和localStorage之间的区别是否仅仅是语义,既存储在本地,又存储在其中的数据具有不同的生存期,而localStorage用于持久存储需要存在的生存期的数据.浏览器实例.

I am wondering if the difference between sessionStorage and localStorage is just semantic with both being stored locally and just having different lifetimes on the data that is stored within them, with localStorage being used to persist data that needs to exist past the lifetime of the browser instance.

推荐答案

本地存储和会话存储都存储在客户端上.区别在于会话存储与会话的生命周期相关,而本地存储则无限期存储.

Local Storage and Session storage are both stored on the client. The difference is that Session storage is tied to the life of the session and Local Storage is stored indefinitely.

这篇关于服务器或客户端上是否存在HTML5 sessionStorage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆