I want to use local session storage to maintain state in my web app, especially if/when the user opens several tabs in his browser.
I have some data that is injected in the HTML on the server. In the document.ready section of the page, I have something like this:
MyStorage = window.sessionStorage;
MyStorage.setItem('MyVar', $('#TheVar').html());
If later on I write this:
ThisVar = MyStorage.getItem('MyVar');
ThisVar = 3;
Will the value in the session storage also become 3? And, will the value of all the variables ThisVar in other tabs also be 3 when I change the value of ThisVar in one tab?
Thanks.