Wednesday, August 22, 2018

javascript - Session storage vs local storage

I understand the gist of how localStorage works compared to sessionStorage, however I'm not clear on one detail concerning sessionStorage. The application I'm working on does an automatic check for the user's location, but if this check fails, the user is presented with a manual region selection. I want to save the user's choice so that when he clicks on a link leading to a specific regional version of the application, the automatic check doesn't start again, causing a potential loop.



The question I have is, does sessionStorage persist after the user goes to the specific regional version of the app, for example from https://www.some-website.com to https://www.eu.some-website.com, or does visiting the new URL create an entirely new session, thus clearing the sessionStorage?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...