I wanted to have, in the administrator page of my app, an overview of the currently logged users.
I thought that by using the condition “is logged in” I could make appear an icon on the logged users.
I am sure this was discussed in another thread somewhere, and it was along the lines of the fact that a user can be logged in and not be active, as the auth tokens are still active.
One option would be to have a last active timestamp on the user object and update it every 5 minutes (15/30/60) or whatever, put a workflow in the header or wherever and read the last value, if > than time above then update it.
Then on the admin dashboard, simply read all user timestamps and if duration < than whatever interval, class them as logged in/active.