aspose file tools*
The moose likes JSP and the fly likes invalidate a session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "invalidate a session" Watch "invalidate a session" New topic
Author

invalidate a session

grace chow
Greenhorn

Joined: Oct 25, 2004
Posts: 13
Dear,
Do you know how to invalidate a user by using a session id in servlet?
regards,
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

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

Joined: May 26, 2004
Posts: 94
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();


http://learnertobeginner.blogspot.com/
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: invalidate a session