Where an electron application's sessionStorage

2019-01-28 11:14发布

I am running an electron app, where in its renderer process I use HTML5 localStorage.
I'm interested to know where in my file-system is this localStorage actually stored (I believe it is in SQLite format).
I saw the answer for where is a browser localStorage stored, here: Where the sessionStorage and localStorage stored?

I'm asking this because I would like to be able to run 2 instances of this electron application, so that each application will have different settings in which I save in localStorage.
Specifically I'm most interested in windows 10, but an answer wrapping all OS will be great.

1条回答
太酷不给撩
2楼-- · 2019-01-28 12:12

It's stored in the AppData folder, which you can find by looking at the value of require('app').getPath('userData').

This means the data persists even if the app is deleted. If you're running two instances, you'll need to find some way of distinguishing between them so they don't trample on each other's data.

查看更多
登录 后发表回答