-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a new column to log users via RememberMe, so we can force user to re-login from the application #721
Comments
I agree we could improve the cookie storage, using a random hash instead of the user id, allowing you to clear it to force users to re-login. This use case could be useful, for example for requesting acceptance of new terms of service, etc |
Thanks for your solutions.
That class checks if a user is active. If not, he is logged out and redirected to the login page. Using a random hash could also improve security as it prevents a user from faking another users's rememberme cookie if its user-id is known?! |
Security issue is not a problem, as the id is encrypted by the server and even if the user know another user's id, he won't be able to inject the correctly encrypted value. |
Ok, I wasn't sure about how/if the cookie is encrypted. Thanks! |
I'll update this ticket a bit to take note of your suggested feature, thanks! |
To force a re-login (invalidate rememberme cookie and current session) it might also be useful, to store the current PHP session-ID in the database (if file-based session handling is used). This helps to invalidate the PHP session quickly. |
@steinkel is this still valid? Should we fix it? |
We just had the situation, that a user account had to stay in the database, but had to be deactivated.
So we destroyed the user PHP Session and deactivated the user.
However the remember_me cookie of the users browser authenticated the user and he got a new, valid session and stayed logged in.
It seems thats because the remember_me cookie stores the users ID and authenticates the user if there is one in the database with the ID from the cookie.
Isn't it possible to check wether the user account is active when he is authenticated using the remember_me cookie?
Maybe it is better to use a random hash that is saved in the database and the rememberMe cookie to authenticate the user instead of just the ID? That would also give us the possibility to remotely invalidate the rememberMe cookie.
The text was updated successfully, but these errors were encountered: