4 ms·
> How does Devise handle 'revoke all sessions for this user'? The cookie has both user id and a special token which IIRC is a substring of the user's password
by spect88 5y ago
> How does Devise handle 'revoke all sessions for this user'?
The cookie has both user id and a special token which IIRC is a substring of the user's password salt. Retrieving current user from cookie includes not only looking up by id, but also verifying the salt. So if you change the password, the salt is also changed and all the old sessions will stop working.
- ibraheemdev 5y agoAh okay, so Devise does lookup the user in the database to authenticate. I guess it's not applicable to my premise then.