Hi,
I am using moodle 3.3 for windows server.
I need the query to fetch count of logged in users.
Regards,
Leena Nikhare
There's a block you can add to (for example) the home page - called 'Online users'.
Note that it really only shows you how many people used the the system in the last 5 minutes. Moodle doesn't 'know' who is logged in. That's done by sessions.
Hi Howard,
From which Moodle folder session data is getting fetched.
Can you please tell me how does it work?
Regards,
Leena Nikhare
You can't... it works the other way around. Session cookies in the browser control logins. You can't detect that.
That's why the block looks at users who have interacted with the site in the last few minutes. It's the best approximation you can get.
You *could* check that users have logged in - that is the event of them logging in but it doesn't do you any good. There's no stateful data to say they are "logged in now". It's not really a sensible question when it comes to web applications unfortunately.
Hi Howard,
Does moodle store any data for logout?
I mean if any user log out record is there stored in database.