Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do you get all sessions?  RSS feed

 
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!