How to manage session for a user logged in from mobile app in PHP?

REST is sessionless for its nature. You need to generate a token when user logged in. You must save this token on your mobile client.
For every request, you need to attach a valid token in request header and check it at server side.
If token expires, the token stored on a client is not valid. So, you need to login again because of 401 response. If token it’s not correct you need to responde 400.
I hope that I’m helpful for you.

Leave a Comment