3 ms·
> storing the "real" expiration in cache so that it can be extended (or revoked) as needed. You can also have a password_last_changed field on your user model
by Alex3917 10y ago
> storing the "real" expiration in cache so that it can be extended (or revoked) as needed.
You can also have a password_last_changed field on your user model, where any token issued before this date is considered invalid. That was if a user's account somehow gets compromised, all they need to do is change their password and then all of their existing sessions are expired automatically.
I can't think of any good reason for storing the expiration dates of each individual token, although maybe there is a use case somewhere.
- jcoffland 10y agoYour missing the whole point. If the server was to track password_last_changed it might as well just track user_currently_loggedin.