We have built a mobile app using Phonegap.
The login flow is as follows:
- User logs in with username/password
- Services returns a token
- Token is saved locally using localstorage
- All future requests are made with this token without issues
Now this is where we are having issues:
- We close the app for several days
- Re-open the app
- Attempt to perform a request using the token saved in localstorage
- Now we are getting a response saying "Anonymous users do not have permissions...."
My question is, what is the lifetime of a token? Is there a way to check the validity of a token?
I have been struggling with this for weeks now.
Comments
Comment #2
tyler.frankenstein commentedThis may be helpful: https://drupal.stackexchange.com/questions/125259/why-is-session-cookie-...
Comment #3
torlearner commentedahhh...the funny thing is, I had this same problem before and corrected it with your proposed solution, but now for some strange reason I forgot to check settings.php :(
Thanks so much for refreshing my memory.
Comment #4
tyler.frankenstein commentedNo problem, I'm glad that fixed it.