-
Notifications
You must be signed in to change notification settings - Fork 235
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
last_login currently useless #188
Comments
Nice idea, I'll add this to v3 |
I'm going to fix it in my v2, so I can try and put together a PR for it once I have it working. |
I must say I disagree with this. "Last Login" should mean the timestamp of the latest login, which if you are logged in would be the time you logged in. What would be the purpose of having the timestamp of the next to last login, other than pure curiosity? Last login is a term used all over, for example by admins looking at user registry to see when people last logged in. |
If you read the post, you'd see it is CURRENTLY useless. As in, it is CURRENTLY broken. |
No need to be snarky. I did read your post, did you read mine? As I said, "last login" should be the lates login you have made, not the one previous to that. |
That makes zero sense. Think about it. For peace of mind and maybe security reasons, I want to see when my account was LAST logged in. As of right now, in the code base, whenever a login is made, the last_login timestamp is updated, meaning you can never know when a previous successful login was made (imagine someone got your password and logged in as you). If you store the previous successful login, a user can easily recognise if it was them that logged in, rather then someone claiming to me them. Do you get it now? |
@paulcanning |
@paulcanning It does make sense. If I log on to my server, let's say Exchange server, as an admin and look at my user table. In the Last_logon field I would expect to see the latest time the user in question logged on. This is the way all systems I've come in contact with handle something called "last_logon". Now I DO see your point about as a user being interested in when my previous login was (even though I think it's an edge case scenario). I don't think the feature is requested enough by users to make it a standard part of an authentication library. I would probably create my own logging table which would log all log in (and log in attempts) to a user and make that available to the user. |
Hey together, @salain The IP address is already in the users & login_attempts table but the user_agent is a great idea. |
The way the
last_login
timestamp it updated makes it practically useless in its current state.The timestamp is updated after a successful login, every time. So you can never actually see the "last/previous" time you logged in, as the single
last_login
timestamp is always updated, wiping away the old timestamp.Really, you need two columns;
login
andlast_login
.login
gets updated with the current time after you log in, andlast_login
is updated with the timestamp fromlogin
just before it gets updated.The text was updated successfully, but these errors were encountered: