0

ive created a grails app and used Apache Shire plugin http://shiro.apache.org/ for security and logging in purposes.

I wanted to find out if anyone knows how I can get a list of the users who are currently logged in to the web application?

Where would this information be stored / on the servers side in a cookie or a session?

Basically i want a widget showing all the current users whom are logged in to my web application currently.

Tyler Evans
  • 567
  • 1
  • 8
  • 25

1 Answers1

0

You would probably have to make a table in your app with currently logged in users (or alternatively a shared hashmap)

When your users log in you write the name to the table / hashmap. The tricky part is to figure out, when the user logs out. If the user logs out by clicking "logout" - no problem. If the users session expires you have to listen to the events fired by Shiro.

According to the Shiro website there are several events you can hook into.

sbglasius
  • 3,104
  • 20
  • 28