Link to home
Start Free TrialLog in
Avatar of MJ
MJFlag for United States of America

asked on

localStorage is restored when page refreshed?

I'm using a Chrome browser and I noticed something weird on one of our sub-domains. if I clear or change local storage, when I refresh the page, the old settings are restored. I have tried to clear at the command line, via Application > Storage > localStorage and Application > storage (hit clear). Regardless I have no idea how to prevent this or get around this issue. Is this an application setting?
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

When you 'refresh' a page, you are reloading whatever it contained when you first loaded it.
Avatar of MJ

ASKER

Hi David, but if I'm changing the localStorage settings that should not be restored. It never worked that way in the past.
Does this happen in more than one browser?
Are you sure that the web page isn't loading the 'local storage' when it loads?
Avatar of MJ

ASKER

Another strange thing, when using developer tools if I type in "localStorage" at the command line it shows the settings. I'f I look at the local storage under Application > Local Storage it doesn't show any entries.
Is this just a case of retrieving a cached copy of the page. Does holding the CTRL key down when clicking on refresh solve the problem?
Try CTRL + SHIFT + R for reload page for new changes
I'f I look at the local storage under Application > Local Storage it doesn't show any entries.
What does your code look like that is accessing localStorage
ASKER CERTIFIED SOLUTION
Avatar of MJ
MJ
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It happens to all of us.
Avatar of MJ

ASKER

Not a real issue.