How to list all currently online admin users?

The question:

In Magento I have created multiple admins with different roles. How do I get the list of online admin users. Similar to the online customers list?

I have used

Mage::getSingleton('admin/session')

but this is providing only the current user’s details.

Is there any build in functions. If not, how to create similar thing?

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

You should know that it is not possible to find out which users are currently on the site, at least not with reasonable effort. The “online customers” list shows all customers that have been active within the last X minutes.

Since there is no visitor log for admins, you don’t have a “last active” time, as it is used for the “online customers” list. You can count all admins that have logged in within the last hour as “online”, or implement an admin visitor log on your own, mimicking the customer visitor log.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment