-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[6.0] Split out logoutAllDevices method #29376
Conversation
I would prefer to have
|
Happy to make that change if it's definitely the preference. Out of curiousity why is it that you want users logged out from all devices by default? When I log out from GitHub or Facebook on one computer it doesn't happen on my other devices, and if it did it would be annoying. |
I'd prefer to go with:
But @crynobone concept is very good too. When you call |
It is a structure that Laravel is been build on, Laravel doesn't keep track where all devices are currently logged on from, unliked GitHub or Facebook. Therefore, it much easier to control remote de-authentication on devices that you no longer want to have authentication. In Laravel we been depending on
I'm against a BC to |
Perhaps GitHub/Facebook were poor examples for the point I was trying to make then - take a look at any Wordpress, Ruby on Rails or generic other web app that isn't actually tracking individual logins and I believe they won't log you out everywhere. I don't believe the common web user would expect that logging out from one device would log them out everywhere, and when it does it's a pretty poor user experience. |
I'm also in favor of keeping the current |
Has anyone explored the security implications of not rotating the remember me token at all? |
I am not sure the current log-out behaviour exactly logs out other devices. It only invalidates the remember-token so they will be eventually logged-out if inactive for 2 hours? It is hard to explain it to users. I don't know what exactly is required to have a real immediate "log-out other devices" feature in Laravel. I think it is already a missing security feature. My preference is to have these 2 functions:
An ideal implementation of
|
I don't have any plans to modify this behavior right now. |
Hey Just for the record (and because I had already written something much longer before the PR was closed ^^), as Halaei explained, the main issue with the current behaviour is that people without remember cookie, but a valid regular cookie/session are just not logged-out at all. I would see two ways to actually achieve that:
Anyway, we can easily extend the SessionGard as a custom auth driver, to override Cheers all 😺 |
This PR resolves the issue described in #29244 where logging out on one device will actually log you out on all devices. This seems like unexpected behaviour to me - most sites wouldn't log you out everywhere like this.
This changes the
logout
method to not cycle the remember token, and adds another methodlogoutAllDevices
(which sits alongsidelogoutOtherDevices
) so that developers can opt-in to this behaviour if that is what they are after.In the linked issue Dries suggested adding
logoutCurrentDevice
instead - I'm happy to make that alternative PR if that's what you guys prefer - but I did want to suggest initially that I think this should be the default behaviour oflogout
.