How to save login information effectively

In my current implementation I save the user login & password in a local storage. At start, I read whether this info exists. If yes, I validate it against a server, if not, I open the login screen. However, it turns out that local storage is not the best solution as it can be deleted by the OS for seemingly random reasons. This is annoying to the user as he has to re-login, maybe forgot his password already, …

How do you solve this? SQLite / File storage? Cookies ??
Is there a standard implementation I have not heard of?