#28256 closed Bug (invalid)
Django `update_last_login` always providing lastest time. not last login time
Reported by: | Vinay Kumar | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | 1.11 |
Severity: | Normal | Keywords: | last_login |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have logged into my site 1 days ago but today when I log into my site, it is showing today date in user.last_login
.
user.last_login
should have yesterday date.
code location.
https://github.com/django/django/blob/a3ba2662cdaa36183fdfb8a26dfa157e26fca76a/django/contrib/auth/models.py#L20
Note:
See TracTickets
for help on using tickets.
last_login
refers to the time of the last successful login action, not to the start- or end-time of the last user session. As mentioned on your StackOverflow question, if you check the value for the current user, that will be the start time of the current session, not the start time of the previous session.