User table - Lastlogin field issue

User table - Lastlogin field issue

by Rafael Satiro -
Number of replies: 4

Hi everyone,

I have a issue in my Moodle (3.6.3) enviroment, this problem is really strange.

I have some users that login in my Moodle and consume ours quiz, foruns etc but when i get the information in my DB they dont have any information in the table USER on field lastlogin, but they have information on lastaccess at the same table.

This issue does'nt happing for all student, i have a lot of results that's works.

Someone here get the same issue? Someone knows what can be?

Thank you so much

Best Regards

Average of ratings: -
In reply to Rafael Satiro

Re: User table - Lastlogin field issue

by Ken Task -
Picture of Particularly helpful Moodlers

May/May not be strange .. does your Moodle force login to see anything contained therein?   Have any Guest accessible courses/content?  Some user in internet could have bookmarked guest course and attempting to go directly to that course without hitting front page.

Consider lastaccess like a search engine bot (google/bing/other) trying to index your site ... lastlogin to be where a user really did initiate and complete a login.

Since you see an IP address ... also cross-reference your web server's access log ... which is a raw server log not seen in Moodle logs.

'SoS', Ken

In reply to Ken Task

Re: User table - Lastlogin field issue

by Rafael Satiro -

Hi Ken,

i dont have any guest acessible course/content.

I run some querys in the moodle log table and i found a lot of logs to the users with this problem:

In reply to Rafael Satiro

Re: User table - Lastlogin field issue

by Ken Task -
Picture of Particularly helpful Moodlers

Did you find the same ip address by query of mdl_user table?

Suggest looking at true web server logs for the ip address to get a truer picture of issues.

If you are running linux ... I have a simple bash shell script to facilitate:

echo 'Searches ssl_access_log and ssl_error_log for parameter given: '$1;
echo 'Paused ....';
read $keypress;
grep $1 /var/log/httpd/ssl_*_log | sort | uniq -c | sort -n

I call the above 'slog' and it could search all logs for the web server rather than just the ssl logs.

'SoS', Ken

In reply to Rafael Satiro

Re: User table - Lastlogin field issue

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
lastaccess is updated by all sorts of things.

For example, reading an email with links back to Moodle can be enough (I think).