Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Are there any ways to retrieve HttpSession object by SessionID (Servlet API 2.3)?

 
Andrei Tarkhov
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there any ways to retrieve HttpSession by SessionID (Servlet API 2.3)?
Thanks a lot,
Astar
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not that I am aware of. You first need to create or bind to a session first with getSession(), and you can get the ID of the current session with getID().
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I recall, that capability was removed from the servlet API because it was thought to be a security risk. In the 2.0 API there was a HttpSessionContext interface but it got deprecated in the 2.1 API.
You can of course make your own methods to track the sessions your servlet creates.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic