Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 572 Bytes

File metadata and controls

12 lines (8 loc) · 572 Bytes

LocalStorage/SessionStorage between different domains

Share data between multiple domains (for example an auth token) can be somehow hard as we all know that all browser side data storage APIs (Localstorage, cookies etc.) are related to one specific domain.

Solution:

Use an iframe to save the data in localStorage, and then the other domains ask the iframe for what we already saved.

Structure

Credit

Thank to Mokhles El Heni