aspose file tools*
The moose likes Servlets and the fly likes URGENT DOUBT 1 --- SESSION HANDLING 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 » Servlets
Bookmark "URGENT DOUBT 1 --- SESSION HANDLING" Watch "URGENT DOUBT 1 --- SESSION HANDLING" New topic
Author

URGENT DOUBT 1 --- SESSION HANDLING

sanjay sawant
Greenhorn

Joined: Mar 15, 2002
Posts: 5
Please this is very urgent.
I need all the help that anyone can give...
public void logout(String login_name,HttpServletRequest req)
{
if(req.isrequestedSessionIdValid())
{
req.getSession().invalidate();
allSessionsHashtable.remove(login_name)
}
}

As soon as users log into the application
i am calling login method of a singleton class
i create session and
store login_name and corressponding sessions
Since multi-login is also allowed it is possible that before the user presses logout button the
session is invalid.
Will above method -logout() work properly
Is req.isrequestedSessionIdValid()
reliable and will this code act the way i want.
 
Don't get me started about those stupid light bulbs.
 
subject: URGENT DOUBT 1 --- SESSION HANDLING