I asked this question in the development forum, but received no responses - hope it’s OK to repost here - could really do with some help on this
I am developing a module for EE and need some advice re the best practice method for getting the member ids for all logged in members.
I am asking because I am unsure whether I can always rely on the sessions table, or do I need to check cookies as well.
Whatever the case, I need to reliably and accurately generate a list of all currently logged in users.
A related question - when do the entries in the sessions table get removed. I am seeing duplication of members in the sessions table on my development system. This is probably due my still debugging the module, but I am not doing anything to place entries in the sessions table, so they must be left over from sessions that were abandoned. I assume that EE has some kind of garbage collection for this - or not?