How do I get a list of all HttpSession objects in a web application?
Let's say I have a running Java-based web application with 0 or more valid HttpSession objects associated with it. I want a way to access the current list of valid HttpSession objects. I was thinking that I could implement an HttpSessionListener and use it to append to a list of session id values that are stored in an application-scoped attribute, but then I'm on the hook to update the list as sessions are invalidated and who knows what else. Before I start baking my own solution I thought I should ask the question: Does the servlet API provide some means of getting access to the complete list