Delete Subdomain Local Storage

Viewed 328

I have two pages: www.site.com, a promotional page with user account and subscription purchase functionality, and app.site.com, where the subscription is activated and used for a service.

I'm migrating more and more of www into app to remove issues like this, but I have state in 3 places currently - in my www. Express.js server session, a cookie that stores a token in the domain '.site.com' to be shared by both, and localStorage that has the user information in app.

When I log-out or the cookie/session expire in www., I can remove the cookie, but I need to remove localStorage from app. I've seen older posts mention iframes that point to the parent domain from the child domain, but ideally, in the same action as the cookie deletion, I'd be able to delete the localStorage of the subdomain by setting a domain or something else similar that I'm overlooking.

Is there a modern way to control localStorage for sub-domains? Thanks!

0 Answers
Related