Localstorage - getting erased in iOS?

Hello guys,
Is anybody running on issues with LocalStorage getting erased on iOS Devices?
What other feature would be an option to store local config settings at the client (iOS) that is not SQLite?
Help…

LocalStorage is NOT considered safe storage and is subject to erasure on all devices but only iOS clearly states this.

Here’s what happens:

  1. The users device runs low on storage/space
  2. iOS goes looking for things it can delete
  3. LocalStorage is low hanging fruit (especially on passive apps)
  4. iOS deletes the local storage without telling you or the user
  5. The user starts your app and it either crashes or the user must login again

Instead of using LocalStorage try using [this plugin](Implement: https://www.npmjs.com/package/cordova-plugin-secure-storage) (it’s more secure too!)

That looks cool but I am using basic web apps to be deployed over an internal server. Everything had been working fine for about 4 years. recently I am having all kinds of different issues. This is one of them. I have quite a bit of devices out there that collect a TON of data. it was a very smooth system.

Nothing worse than running smoothly and then not! LOL

iOS dev docs make it clear that LocalStorage is fair game and not to depend on it beyond the current session. Apple doesn’t single out cordova apps but all web apps. Heck, cookies get a higher priority than LocalStorage.

First thing I’d do is have the iOS users screenshot me their device storage readings via Settings->General->iPhone Storage and see how that looks,

Next I’d get the iOS version and see if something specific to one version (there may be a known bug or you may find it and get that bug bounty! LOL ).

Lastly, I’d see what the user did just prior to the problem: Did they restart their device? Clear their cookies?

Thanks for taking the time to answer me. I really appreciate it. Looks like I have to switch to PhoneGap and use those plugins. I just have to now figure out how to get started.

I had a similar issue so now just write/ read a text file on the server. Not ideal but simple to do. I only needed a common file but I would guess you could create a unique file for each user using the device serial.