and*_*abs 5 html javascript local-storage
意识到以下问题:
(来自:http : //diveintohtml5.info/storage.html)
我决定使用 localstorage 而不是 cookie。
问题:我可以像使用 cookie 一样将本地存储上下文限制为特定路径吗?
正如评论中已经提到的,webstorages ( localStorage, sessionStorage) 的范围是每个来源。
用户代理必须有一组本地存储区域,每个源一个。
来源:http : //www.w3.org/TR/webstorage/#the-localstorage-attribute
让我们引用 w3.org wiki 页面上的同源策略:
来源由 URL 的方案、主机和端口定义。
来源:http : //www.w3.org/Security/wiki/Same_Origin_Policy