• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do you get all sessions?

 
K Riaz
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the Servlet API allow you to retrieve all active sessions? I need to iterate through each one, looking for a particular attribute in the session and then invalidate the session.

I see that HttpSessionContext existed for some time before being removed. Any alternatives?

Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One alternative is to use a session listener and a context scoped map to store references to all the sessions.

There was a fairly detailed thread on this a while back.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For security reasons you're not allowed to snoop through other sessions.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic