语言

Menu
Sites
Language
Is LocalStorage safe?

Hi,

I'am using the LocalStorage to save some application data. Now some users have reported, that in some rare cases, the data appears to be lost and they need to perform a login again.

So is it save to use LocalStorage or should I save the application data otherwise?

响应

2 回复
Marco Buettner

It will interest to know the "rare cases"... Before I change to indexedDB I used localStorage as database ;D And I never lost data.

AVSukhov

Hello,

Data saved in localStorage will not be deleted when the app is closed, and will be available the next day, week, or year. =)

Given that the user did not clean them or clear app data from settings or reinstall app or it may be software bug (in this case it is necessary to investigate a particular cases).