Have Local Storage updates sync across tabs without refresh

I was working on implementing a feature where a user logs into the site in one tab and all the other tabs get logged in automatically as well without having to manually refresh each page. When the user is logged in, I store a particular value in Local Storage, and the plan was to have the other tabs auto refresh when the value in local storage is updated.

However, after a bunch of tests, I found that changes to Local Storage values are not reflected in other tabs until you refresh the tab. It would be nice if other tabs could react to changes made in a different tab without having to reload the page.

A workaround is to use websockets and have every tab join the same channel, but it would be much easier to just use local storage.

Community Page
Last updated: