-2

In my Angular apps, I have two domains and I need to pass data from domain1 to domain2.

How I can do this ? I used localStorage but it doesn't possible to share in my second domain.

And using cookies work ? I saw no...

  • Why not handle it server-side, by sending a POST or GET request from the first domain to the server at the second domain? – JoshG May 23 '18 at 07:48

1 Answers1

-1

Using localStorage or cookies doesn't work cross domain, for the security reasons.

What kind of data do you wish to pass on?

If it is your application logic, I would suggest you handle them at your server.

  • It is possible to [share localStorage across domains](https://stackoverflow.com/questions/33957477/cross-domain-localstorage-with-javascript) using iframes with `window.postMessage()`. – Anderson Green May 22 '22 at 15:56