website from the android application ? Any idea ?
I normally use a combination of a token in a heather with a cookie session using REST& Retrofit to communicate with server. The cookie holds all the session info, like user ID, session ID, device and other. The token is used in each call to the server to identify the user. If the session ID is still valid on a call, of will generate a token that matches what the user send so his session is still active and can communicate with server. If not, his session had expired so he has to re login. As I save his user and pass in an encrypted database in the phone, I can re login without user interaction and send from server to phone a new token & cookie valid pair. Not as difficult as it seems. I hope I make myself clear. English not my first language. This is the method I use. Don't know if it's best.
Обсуждают сегодня