cancel
Showing results for 
Search instead for 
Did you mean: 

Retriveing the count of logged-in users

Former Member
0 Kudos

Is there any way to find out how many users are currently logged in my Hybris website ? I understand that from Hybris Admin Console we can get the count of HTTPSession but I am looking for a more accurate way. Please suggest if there is any better way I can achieve the requirement.

Accepted Solutions (0)

Answers (2)

Answers (2)

christoph_meyer
Active Participant
0 Kudos

You could count all jalosessions that have a user of type customer attached to it. I would not recommend doing that in realtime too often, though, there can be a lot of sessions active...

Former Member
0 Kudos

This would be the best way of doing it although we would also need to filter the anonymous sessions which still have a customer reference e.g.

 de.hybris.platform.servicelayer.user.UserService.isAnonymousUser(UserModel)

Unless you're replicating sessions across the cluster this is just giving you the number of logged in users for a single node.

Former Member
0 Kudos

Could you add an example how to count all jalosessions that have a user of type customer attached to it?

Former Member
0 Kudos

There is not OOTB feature like this. What do you mean by more accurate way ? If you can share your thoughts more than we can suggest you something which is feasible.