Skip to content Skip to sidebar Skip to footer

Html5 Local Storage Only Returning Values On Home Page, Not Other Pages

This is my first time working with localStorage, and I'm trying to store a json object which I am stringify(ing). On my home page, I use the following code localStorage.setItem('

Solution 1:

Modern browsers have decided that local files ("file://" URLs, in other words) are not all to be considered members of a common "domain", at least for some purposes. Chrome seems to be the strictest, but maybe in the HTML5 features Firefox is also as strict.

It kind-of makes sense: if somebody invents some kind of TiddlyWiki-like tool that uses HTML5 storage, you wouldn't want its stuff to be available to some random other HTML file you download for totally unrelated reasons.


Post a Comment for "Html5 Local Storage Only Returning Values On Home Page, Not Other Pages"