Joseph James Shenton Joseph James Shenton - 21 days ago 9
Javascript Question

Can two folders share the same localStorage?

I am making an app that changes settings on my other app; they are both hosted on the same site just in different folders. Is there a way to make it so they both share the same localStorage?

Answer

localStorage is domain based. All pages with same domain share single localStorage.

Also to share localStorage, both pages need to have the same port and protocol like https.