Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LocalStorage disappears in chrome after page refresh

It's fine on the first load but as soon as I refresh, despite it being available from the console, it's not visible in the applications tab.

What do I do about this?

I'm on version 57.0.2987.133

Image of the issue

like image 473
David Alsh Avatar asked Apr 15 '17 00:04

David Alsh


People also ask

How do I keep Local Storage after refresh?

To store the form data in JavaScript localStorage, we'll use the setItem() method. It stores the data in the localStorage object and takes the key and value parameters as input. The parameters can be later used to retrieve the data when the browser reloads the page or a new session is initiated.

How do I turn on Local Storage in Chrome?

Just go to the developer tools by pressing F12 , then go to the Application tab. In the Storage section expand Local Storage. After that, you'll see all your browser's local storage there.

Does Local Storage clear on browser close?

localStorage is similar to sessionStorage , except that while localStorage data has no expiration time, sessionStorage data gets cleared when the page session ends — that is, when the page is closed.

Where is Chrome Local Storage stored?

Google Chrome records Web storage data in a SQLite file in the user's profile. The subfolder containing this file is " \AppData\Local\Google\Chrome\User Data\Default\Local Storage " on Windows, and " ~/Library/Application Support/Google/Chrome/Default/Local Storage " on macOS.


1 Answers

As wOxxOm mentioned, this is currently a bug on Chrome but fixed in canary 59. I'm on 58.0.3029.110 (64-bit) and still seeing the issue.

You can try on Safari and shouldn't see the issue.

like image 163
Won Jun Bae Avatar answered Oct 20 '22 18:10

Won Jun Bae