I'm building an Android cloud app that authenticates a user on a PHP/MySql server. I would like to use sessions as to not need to ask the user to authenticate himself every time he communicates with the server. However, sessions don't last forever, and it won't take long before the user has to authenticate himself again. Is there a way to make the sessions last forever, except when the user wants to log out?
If not, I find it would be just easier to keep the user credentials in memory on the app, and then send them each time the user communicates with the server.
Any ideas? Any other solutions?