Angular window.localStorage for different subdomains

I am using Angularjs in my project. I installed window.localStorage['foo'], but I need to use the data in other subdomains. For example, it starts with domain.comand goes to sub1.domain.com=> sub2.domain.com.

So, when I try to use subdomains, I cannot access window.localStorage['foo'], and I need to install everything again.

Is there any other way to do this?

thanks

[DECISION]

I used ng-cookie and worked well. angular / bower- angular -cookies

$cookies.put('myCookie', value, { domain: 'domain.com'} );

Thanks everyone!

+4
source share

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


All Articles