0

I built my APIs with laravel 5, both my web application and mobile app use the same APIs. On the web app there is a default expiration of 60 minutes after which user will have to log back in again. However on mobile i do not want that, no automatic session expiration for mobile, the user can only be logged out after they have clicked the logout button on the app.

I use JWT with satellizer for my authentication, i would like to know how to achieve this.

user3718908x100
  • 7,939
  • 15
  • 64
  • 123

2 Answers2

1

I have the same setup as you have on my web application and mobile app. I simply store the username/email and password on the phone (native) and everytime the user opens the app it does a call to receive a new JWT. When the user is loggin out on the phone, the password is removed.

I think this is the simplest solution, and for security you can encrypt the password in the storage.

1

I believe the current practice based on this answer is that you prolong or refresh the token before it expires. I do not believe you can't not have an expiration.

Community
  • 1
  • 1
Sean Larkin
  • 6,290
  • 1
  • 28
  • 43