3

Since Chrome 61 it appears that any item added to the local stage no longer gets created as a phsyical file within the local profile.

Previously running the command

localStorage.setItem('key', 'value')

Would create a SQLite file corresponding to the website in...

%localappdata%\google\chrome\user data\default\local storage\

But this now no longer seems to be the case, new items are simply no longer created in this location.

Anyone have any ideas if this behaviour has been deprecated?

Or alternatively any idea how to add to the local storage in chrome so that a physical file gets created?

Nisarg Shah
  • 14,151
  • 6
  • 34
  • 55
James Amos
  • 316
  • 1
  • 10
  • I doubt that was ever officially supported. If it is not part of the spec, browsers can change that behavior anytime they want, without informing the community/users. – Nisarg Shah Sep 20 '17 at 14:48
  • Google can change this at any time, without any advance notice, completely at their own discretion. –  Sep 20 '17 at 14:54
  • Using Chrome `100.0.4896.127`, local storage data is still being logged in in the mentioned folder. I was able to recover some data after I navigated from `http` to `https` with no way of coming back other than rolling back the NGINX setup. Thanks! – GuiRitter Apr 25 '22 at 15:03

2 Answers2

5

Looks like it's now stored in a LevelDB database. See https://crbug.com/586194, Chrome Service Model, and LocalStorage using Chrome Service Model if you want to learn more.

Josh Lee
  • 171,072
  • 38
  • 269
  • 275
0

I struggled to find this file too, as Google engineers keep rewriting their own specs and changing the design every other year. :(

As of 2022, the browsers each use different systems for storing window.localStorage and window.sessionStorage data, much like they do JavaScript, CSS and HTML5. The Chrome browsers abandoned SQLite years ago and are using some new "LevelDB API" framework for accessing and storing this data in a shared resource database set of files the API controls and encrypts. I am assuming that is for security and speed reasons, mainly. I found this data being stored in a series of *.ldb files and other proprietary formats below for Windows users in the following folder location, which you cannot really access but at least see its being updated:

\Users\{your name}\AppData\Local\Google\Chrome\User Data\{optional profile}\Local Storage\leveldb\

Stokely
  • 12,444
  • 2
  • 35
  • 23