How do I get a list of all currently logged-in users?

hello together,

today I want to know how I can create a list of all currently logged-in users.
I have not been able to find a kirby-function doing this. Did I miss something?

So for now the idea is to go through the .sess-files in /site/sessions and collect the user-ids from those sessions whose expiry-date lies in the future.

Is there a better option or would this be the best way to go?

Thank you for the help!

Ralf

You could create a log when a user logs in and out using the user.login:after and user.logout:after hooks.

Thank you!
I thought about that too. But i was unsure, if the logout:after-hook is triggered if the user does not log out actively. Is it?