Is there a modern alternative to sessionStorage that works in all subdomains?

We recently switched from cookies to using sessionStorage - the trigger for switching was IE problems .

Now we find that sessionStorage does not work across subdomains - the www.site.com repository www.site.com isolated from the site.com repository.

Is there a modern alternative to get them to collaborate? This is easy to do with cookies, but I would not want to return from sessionStorage or (gasp) use both methods at the same time.

+6
source share
1 answer

It's almost a hack, and it's not safe, but it's a neat trick nonetheless. The JavaScript window.name object can contain data strings, and the data is saved even when loading a new page or switching domains. Check it out here:

Using window.name as a local data cache in web browsers

+3
source

Source: https://habr.com/ru/post/918568/


All Articles