sessionStorage/localStorage scope

Firstly, localStorage and sessionStorage are 2 objects on the window object. They tie to the origin of the current window. As a result they are bind to : protocol, http/https are different domain subdomain can share with parent by manually setting document.domain. xxx.capitalone.com cannot share with yyy.capitalone.com port Same thing apply to 302 redirect. The session/local storage value…

window sessionStorage vs localStorage

They are almost the same. However if you want to store info beyond a tab, which means even after a tab is closed, then use localStorage Opening a page in a new tab or window will cause a new session to be initiated. That means that info stored in sessionStorage can’t share between tabs. more details could be…