View Logged In Users is empty

In Bahmni, when we are trying to see all the logged in Users using Openmrs/Administration/Maintenance/View Logged In Users, no users are being displayed. The API call made is /openmrs/admin/maintenance/currentUsers.list Any idea if this was working earlier? Is there any other way to get currently logged in users in Bahmni/Openmrs

The User Login is considered for LoggedInUsers only when the user has logged in from /openmrs ui. Hence even though there is active session through Bahmni, still it is not considered. Hence the intended behavior doesn’t exist

1 Like

We use the REST end point to login. Is there a gap in webservices rest vs OpenMRS interface?
If so, then we should raise it, even better fix it.

@pramidat , alternatively, you can always get details from Tomcat. Remember we use embedded tomcat, and tomcat will have APIs to see sessions. So options are

  1. Fix any gap in Bahmni if its in our control.
  2. Fix the WebServices rest if there in lies the issue
  3. Fix using Tomcat APIs
  4. Tomcat has ability to register Interfaces for AccessLog. I wrote one such interface plugins in my previous life!
  5. Tomcat has JMX support.
  6. You can even register Session Listeners (HttpSessionListener) and do fancy things.

So you have tons of choices for resolution. Choose wisely. :slight_smile:

My pick - 1 or 2 (obvious)

1 Like

Peeking at the code, it looks like OpenMRS’s entire “Logged In Users” functionality is implemented via the legacy UI:

In other words it ignores logins from REST and from the Reference Application (in addition to Bahmni).

I think the correct fix would be to move this functionality into openmrs-core so that all distributions can leverage it. This would require some refactoring since the current implementation is built around HTTP Sessions and the ServletContext, and openmrs-core doesn’t usually touch these.

The quickest fix from the Bahmni perspective is probably to try to call the utility methods in CurrentUsers when people log in and out (since Bahmni does include the legacy ui module).

2 Likes

Absolute necroposting here, but this is still a problem.

Here’s a related ticket, also extremely old and extremely unresolved: https://issues.openmrs.org/browse/RA-552

1 Like

how do you suggest we resolve this?

1 Like

The problem is in which version of the reference application? cc @bistenes @angshuonline @darius @pramidat

It doesn’t work in the latest, but it seems like it hasn’t worked for more than two years now.

this is what i have . @bistenes

if we use the demos version http://demo.openmrs.org/openmrs/admin/maintenance/currentUsers.list

we will get this :

I think the problem is that if you use Webservices REST APIs, then it does not show.