We are working on two web applications that are hosted on two different subdomains of the same domain:
https://subDomainA.domain.comhttps://subDomainB.domain.com
Both web applications are showing an iFrame hosted on a third subdomain:
https://subDomainC.domain.com
We are using postMessage to communicate between top window and IFrame window.
Within the iFrame shown on subDomainA, we are setting an AuthToken:
localStorage.setItem("AuthToken", "JWTAuthToken")
When we navigate to subDomainB and try to run the following code within the iFrame:
localStorage.getItem("AuthToken")
The result is null.
- This only happens in the Safari browser.
- All other browsers share the LocalStorage within these IFrames
- We are on the same domain, i.e. the same "eTLD+1" (
domain.com) - Doing the exact same thing with cookies works!. Just not with LocalStorage
- Opening subDomainC directly in the browser and setting the data persists them for the IFrames as well.
Is this a indended behaviour of Safari or do we have an issue with our implementation?