How to fetch all current loggedin usersHow to fetch all current loggedin usershttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=479741052024-03-29T12:30:50Z2024-03-29T12:30:50ZRE: How to fetch all current loggedin usersDavid H Nebingerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=479902252015-01-21T14:24:21Z2015-01-21T14:24:21ZIt won't matter if you're using Liferay in a cluster. His code will only give you the users logged into a given node, not the entire cluster. That list does not exist.<br /><br />If you don't know the companyId thing, then you're probably too green as yet to be accessing the portal core to grab the list and display it within a portlet. All data stored in Liferay is keyed off of a company id (to support virtual hosting). You need to know what company id you're using so you can get the list of it's locally logged in users.<br /><br />But honestly I can tell you that this is not a path that is going to give you what you want. There is no current list of logged in users because users do not have to log out (they can just close their browsers, their computer/browser can crash abruptly stopping any communication, network links can drop i.e. you take your phone out of cell range, ...).<br /><br />Whatever list you think you're going to get and whatever you expect to do with it, well I can tell you that 99% of the time it will be incomplete and inaccurate.David H Nebinger2015-01-21T14:24:21ZRE: How to fetch all current loggedin usersMadhu Chandrappahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=479830802015-01-21T12:55:57Z2015-01-21T12:55:57Zhi<br />am newer to liferay. so am not getting u. what is companyId and am getting companyId as NULL.Madhu Chandrappa2015-01-21T12:55:57ZRE: How to fetch all current loggedin usersJitendra Rajputhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=479853222015-01-21T12:29:02Z2015-01-21T12:29:02Z<html><head></head><body>After enabling live user property in portal-ext you can use below API to get list of logged in users.<br><br><pre><code>LiveUsers.getSessionUsers(long companyId)</code></pre><br><br>Note : LiveUsers class is in portal-impl you can not use directly in your plugin . You can use PortalClassInvoker to access portal-impl classes.<br><br><br>Thank you,<br>Jitendra</body></html>Jitendra Rajput2015-01-21T12:29:02ZRE: How to fetch all current loggedin usersMadhu Chandrappahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=479827372015-01-21T12:12:24Z2015-01-21T12:12:24ZThanks Jitendra<br /><br />but how to display it in jsp page..<br /><br />Thanks<br />MadhuMadhu Chandrappa2015-01-21T12:12:24ZRE: How to fetch all current loggedin usersJitendra Rajputhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=479774532015-01-21T10:25:18Z2015-01-21T10:25:18Z<html><head></head><body>Set below property to true to get list of live users. Once you enable this property you will see live data under monitoring tab in control panel.<br><br><br><pre><code>##
## Live Users
##
#
# Set this to true to enable tracking via Live Users.
#
live.users.enabled=true</code></pre><br><br>Thank you,<br>Jitendra</body></html>Jitendra Rajput2015-01-21T10:25:18ZHow to fetch all current loggedin users