Is Html5 Local Storage Data Stored Seperated By Domain
Solution 1:
From the spec:
User agents must throw a
SecurityErrorexception whenever any of the members of aStorageobject originally returned by thelocalStorageattribute are accessed by scripts whose effective script origin is not the same as the origin of theDocumentof theWindowobject on which thelocalStorageattribute was accessed.
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".
Solution 2:
If so how do I access it from another domain?
You cannot.
LocalStorage data is created based on the domain of the web page. That data is then only accessible from web pages under the same domain.
Here is why this is a good idea: Would you want a site like hackerz.pwn to be able to read/write/remove this?
Example (page on www.yourbank.com):
window.localStorage.setItem("user_session", "1234567");
Post a Comment for "Is Html5 Local Storage Data Stored Seperated By Domain"