HTML5本地存储数据是否由域分开存储 [英] Is HTML5 Local Storage data stored seperated by domain

查看:114
本文介绍了HTML5本地存储数据是否由域分开存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试过浏览HTML5本地存储,但我似乎找不到直接的答案。

I have tried looking around about HTML5 Local Storage but I can't seem to find a straight answer.

本地存储是否基于Domain存储其对象饼干?

Does the Local Storage store its objects based on Domain like cookies?

如果是这样,如何从其他域访问它?

If so how do I access it from another domain?

推荐答案

规范


只要存储 SecurityError 异常c>最初由 localStorage 属性返回的对象由脚本访问,其有效脚本来源与 Document localStorage 属性的 Window 对象的$ c>。

User agents must throw a SecurityError exception whenever any of the members of a Storage object originally returned by the localStorage attribute are accessed by scripts whose effective script origin is not the same as the origin of the Document of the Window object on which the localStorage attribute was accessed.

您无法从存储在那里的任何域以外的任何域访问存储在 localStorage 中的数据。它遵循与 XMLHttpRequest 相同的模型 - 相同的原始政策。

You cannot access data stored in localStorage from any domain other than the one that stored it there. It follows the same model as the XMLHttpRequest - the "same origin policy".

这篇关于HTML5本地存储数据是否由域分开存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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