Get active user session

Certified Lead Developer
How can we find whether a particular user is currently logged in or not?

The login audit will gives us only last login time and AFAIK there are no logout audits.

I haven't find any functions, audits, classes in API to get the user session. Do we have any user session objects at server side? So that I can create a plugin to do this functionality.

OriginalPostID-241456

  Discussion posts and replies are publicly visible

Parents
  • Few ideas: 1) to check with login-audit.csv every time -> not a good idea if you have distributed system and logs are not centralized 2) Push login data in periodically in DB and check with login time from DB + default session timeout 3) Not recommended, write you own 'session listener' (configure in web.xml) to push login data into db (extracted from SPRING_SECURITY_CONTEXT) everytime when user login or logout.
Reply
  • Few ideas: 1) to check with login-audit.csv every time -> not a good idea if you have distributed system and logs are not centralized 2) Push login data in periodically in DB and check with login time from DB + default session timeout 3) Not recommended, write you own 'session listener' (configure in web.xml) to push login data into db (extracted from SPRING_SECURITY_CONTEXT) everytime when user login or logout.
Children
No Data