This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic