This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

invalidate a session

 
grace chow
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear,
Do you know how to invalidate a user by using a session id in servlet?
regards,
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You neednt have a session id to invalidate a session. Get a handle to the session using request.getSession(false) and on the session object returned, call the invalidate() method.

ram.
 
Poobhathy Kannan
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can not invalidate user using session id.you can remove user from session..
HttpSession session = request.getSession();
session.removeAttribute("user");

or you have to invalidate session..
session.invalidate();
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic