How do I get a list of all HttpSession objects in a web application?

No, the Servlet API doesn’t provide a way. You really have to get hold of them all with help of a HttpSessionListener. You can find several examples in the following answers:

  • How to find HttpSession by jsessionid?
  • How to find number of active sessions per IP?
  • How to check Who’s Online?
  • How to invalidate another session when a user is logged in twice?

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)