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

torlearner created an issue. See original summary.

tyler.frankenstein’s picture

Category: Bug report » Support request
torlearner’s picture

ahhh...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.

tyler.frankenstein’s picture

Priority: Major » Normal
Status: Active » Closed (works as designed)

No problem, I'm glad that fixed it.