User authentication client side storage

I am thinking to extend my ionic app with a user login frontend and data backend. Right now, I am saving all user data in Localstorage . This has proven as bad because Localstorage can be erased on seemingly random occasion by the OS when it runs on low memory / storage. Had some frustrated users due to this. :stuck_out_tongue:

I tried the cordova file plugin, but they do not work well, and sooner or later I would have to move to user auth anyhow.

So, what is the best solution client side to store auth data? I do not want users to enter credentials every time the app starts. Where should I store the user name / password other than Localstorage - since that, as mentioned above, can be erased by the OS. Cordova file plugins currently do not perform well for me, so I will not go for files…


you can use sqllite to store user data?

Yeah, makes sense.
I’m looking into the cordova sqlite plugin. Question - does openDatabase create the file automatically if it does not exist? I seem not to be able to find documentation for it…

Hmm I think it will automaticly create the database (the actual file). But you need to check manually if the tables exists and create.