0

I use login with facebook in nodejs. I set facebook return url to: api.example.com/api/return.

I also store the token in localStorage and I don't want to use cookie.

when I return to api.mysite.com/api/return I make sure if it success, then I response with 200 and script: window.location = 'https://example.com'.

The problem is I want to change the localStorage in https://example.com, but I'm in https://api.mysite.com.

Is there a way to change the localStorage in https://example.com, from https://api.example.com?

Jon Sud
  • 10,211
  • 17
  • 76
  • 174
  • Does this answer your question? [In HTML5, is the localStorage object isolated per page/domain?](https://stackoverflow.com/questions/4201239/in-html5-is-the-localstorage-object-isolated-per-page-domain) – Tigger Jul 26 '20 at 09:37
  • No! there is no direct way to do that currently. There will be a lot of work that needs to done to achieve that. – Always Helping Jul 26 '20 at 09:38

1 Answers1

0

I think you could use cross-storage. Basically, the concept is that there are hubs and clients:

  1. hubs: reside on any server, interact directly with LocalStorage API.

  2. clients: load the hub using an embedded iframe, and post messages, interact with data.

Always Helping
  • 14,316
  • 4
  • 13
  • 29
Giovanni Esposito
  • 10,696
  • 1
  • 14
  • 30