Invalidating session in jsp Chat sex no registrations straight in to chat
You can call invalidate to discard an entire session.Just remember that doing so causes all of that user’s session data to be lost, not just the session data that your servlet or JSP page created.But my code doesn't work after invalidating the session when i click on submit without filling username/password it still takes the old value...please tell me where am i going wrong??Behind the scenes, the system extracts a user ID from a cookie or attached URL data, then uses that ID as a key into a table of previously created Http Session objects.
• Log the user out and delete all sessions belonging to him or her. When a user hits the log out button it directs them to that page, which in turn checks for an active session and if it finds one, calls session.invalidate() then redirects the user back to the home page (or wherever you would like). Take a look at this thread, it has some answers that you are looking for. t=146975 I use a servlet for the sole purpose of log outs.But I am not sure, if this deletes some necessary session-attributes like login-data. Edit: The best solution would be, each time you open a certain page you create a new session for that window/tab until you close the tab or revisit that page in this tab.This question occurred by the attempt to solve this problem.