-1

I have a login system (x.x.x.x: 8000) that generates a localstorage. When a user clicks a certain button it goes to another system (x.x.x.x: 8001) and needs the information stored in the previous system's localstorage (x.x.x.x: 8000). Is it possible to share the localstorage generated in the login system (x.x.x.x: 8000) with other systems?

Thank you very much

fabbaraujo
  • 11
  • 3
  • 2
    Local storage is, by definition, locked to a single machine and a single host. You could setup some kind of backend endpoint which saves that data and another which retrieves it though. – Mike Cluck Nov 08 '18 at 17:34
  • Thanks for the answer. I'm using JWT (dotnet and vue). How could I do this token transaction between the two systems? – fabbaraujo Nov 13 '18 at 15:13

3 Answers3

0

It might be worth looking into this library as a solution to your problem: Cross Storage

This library enables multiple domains to share the same localStorage. Hope this helps!

Wes Winder
  • 1,233
  • 1
  • 8
  • 7
0

Web storage ( local storage & session storage ) only allowed to store data per origin ( per domain & protocol ). That means you the browser can't share data between different origin.Local storage across different domains The attached link have a good explanation about the cross storage.

0

There is a complete thread about sharing localStorage between subdomains here: use localStorage across subdomains

You could use the recommended IFRAME technique. You can call a page on x.x.x.x:8001 from x.x.x.x:8000 info an IFRAME, before the user click, to store the data needed on x.x.x.x:8001. By doing so, you would be able to retrieve the data needed after the user click.

Jeremie
  • 646
  • 8
  • 24