I am writing a user script which use Local Storage to save users' setting. As local storage is unique for each domain, how can I share the Local Storage between example.com and www.example.com?
Asked
Active
Viewed 647 times
2
-
See also: **[how to access a subdomain's html5 localStorage from the root domain?](http://stackoverflow.com/questions/3343645)** and **[Access root domain's localStorage from subdomain](http://stackoverflow.com/questions/3414809)** – hippietrail Oct 12 '12 at 11:33
1 Answers
-1
The easiest way to avoid the problem - just don't use both non-www and www domain names at once, you should choose one and do permanent redirect from second one. The reasons for this are not only connected with local storage, the main issue here is search engine optimisation.

NOtherDev
- 9,542
- 2
- 36
- 47