One localStorage for all subdomains. It is impossible, but it might still possible?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
6 views
A multilingual project. Each language corresponds to a subdomain, and there are special subdomains for static and special versions (like the Wikipedia):

en.example.com
ru.example.com
...
static.example.com
m.example.com
fb.example.com
vk.example.com
...



Users during operation will accumulate the data that is in principle not necessary on the server side, plus these data can be larger than 4 KB ie cookies use is not desirable.

HTML 5 localStorage, a seemingly perfect fit, but there is one big "but": the data stored for a single subdomain are not visible on all the other subdomains according to the specification of security concerns.


Could you, dear harrowdale, to recommend how to implement local data storage in this case? Did anyone else with a similar problem, successfully solving it? Maybe is any way to use iFrame to store the localStorage there and "chat" with him? Are there any other approaches to solving this problem?
by | 6 views

4 Answers

0 like 0 dislike
You can use 1 twisted way.
Use postMssage, which will broadcast the queries to the localStorage on a special page, Ala localStorage.example.com :)
\r
By the way, you can play with the attempts to reach out directly to localStorage ifram'a fact, 2рого domain level pages will be the same. I do not remember, just, will do the security policy.
by
0 like 0 dislike
Can offer such crutch:
make an invisible iframe, load a page from any shared domain, for example localStorage.yoursite.com implement in the script on this page functions with storage
the interaction with this organize iframe-based hack with the hash (on the same basis made of the so-called XHRIFrameProxy)
by
0 like 0 dislike
Try to use the script from this article: Evercookie — the most stable cookie
by
0 like 0 dislike
globalStorage if it supported chrome :(
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
4 answers
0 like 0 dislike
7 answers
0 like 0 dislike
4 answers
110,608 questions
257,186 answers
0 comments
26,934 users