• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
 
Ranch Hand
Posts: 1512
  • 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().
 
Author and all-around good cowpoke
Rancher
Posts: 13078
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
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter
https://coderanch.com/t/690611/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!