I am in progress of creating an Android Application which should have ability to share content with other users and I am planning to use PHP backend.
I want users to log in to my web service to avoid trolling and filling my service with useless data.
But now that I am using Android to access the service, I know its simple to create a HTTP post and send the login credentials to server but how to keep the session alive?
As far as I know its common to just keep the application logged in to the service with mobile phone, at least when there's no personal data available.
How should I store the data that Android device has been logged in?
Lets say I created a MySQL table that would contain the user, password and id.
I thought about generating unique id for the device, using ANDROID_ID or IMEI and associate it with the user id that has been logged in my web service, but that doesn't seem secure enough.
How does other applications do this?