This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv 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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "invalidate a session" Watch "invalidate a session" New topic

invalidate a session

grace chow

Joined: Oct 25, 2004
Posts: 13
Do you know how to invalidate a user by using a session id in servlet?
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.

Poobhathy Kannan
Ranch Hand

Joined: May 26, 2004
Posts: 94
you can not invalidate user using session can remove user from session..
HttpSession session = request.getSession();

or you have to invalidate session..
I agree. Here's the link:
subject: invalidate a session
It's not a secret anymore!