This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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/
 
wood burning stoves
 
subject: invalidate a session
 
It's not a secret anymore!