use localStorage across subdomains

This is how I use it across domains…

  • Use an iframe from your parent domain – say parent.com
  • Then on each child.com domain, just do a postMessage to your parent.com iframe
  • All you need to do is setup a protocol of how to interpret your postMessage messages to talk to the parent.com iframe.

I hope it helps 🙂

Leave a Comment