Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74131

LocalStorage variable auto disappear

$
0
0

This is might be a dump question but i could not figure it out why. So, i have to permanently store some configuration number into the browser, so if the app reload, it can get those config number right away. I think we can do it by using localStorage. I implemented and got it working, using :

localStorage.setItem('token', 'fsdfdsfsdfdsfds');
localStorage.setItem('config1', 'config1');
localStorage.setItem('config2', 'config2');
localStorage.setItem('config3', 'config3);

However, after 2 hours all of the config1, config2, config3 are gone. Only the token one still exists in localStorage. I though that item in localStore should stay as long as we want. We have full control over it.

Any explain here ? Thanks


Viewing all articles
Browse latest Browse all 74131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>