localStorage何时清除? [英] When is localStorage cleared?
问题描述
我可以期待多久可以将数据保存在localStorage中。普通用户的localStorage数据会持续多久?如果用户没有清除它,它会持续到浏览器重新安装吗?
这是否跨浏览器一致?
一篇好文章也是 http://ejohn.org/blog/dom-storage/
How long can I expect data to be kept in localStorage. How long will an average user's localStorage data persist? If the user doesn't clear it, will it last till a browser re-install?
Is this consistent across browsers?
W3C draft says this
User agents should expire data from the local storage areas only for security reasons or when requested to do so by the user. User agents should always avoid deleting data while a script that could access that data is running.
So if browsers follow the spec it should persist untill the user removes it on all browsers, I have not found any that have deleted on any off my projects.
A good article to read is also http://ejohn.org/blog/dom-storage/
这篇关于localStorage何时清除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!