Solved

Does HttpSession.invalidate function kill all the sessions?

Posted on 2004-04-07
3
689 Views
Last Modified: 2008-02-01
I have 2 webserver, each one tied with an app server.  The session timeout has been set to 4 hours.  But sometimes after couple of minutes, the user is kicked back to the login page.  I am not sure if HttpSession.invalidate is the cause?  Pls advise.

Thanks.
0
Comment
Question by:radha77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 10781227
Yes, the invalidate() method DID kill all the sessions, to kill only a particular session object, try use the removeAttribute method:

Example:

<%

session.setAttribute("test", "124");

out.println(session.getAttribute("test")+"<br>");

session.removeAttribute("test");

out.println(session.getAttribute("test")+"<br>");

%>

Hope this helps
0
 

Author Comment

by:radha77
ID: 10783804
Thank you.  I have another question ... What is "test" and "124" in session.setAttribute("test", "124");  Is that any random name, or does it have to be the userid?  Pls advise.

Thanks.
0
 
LVL 52

Accepted Solution

by:
Ryan Chong earned 250 total points
ID: 10789232
>>Is that any random name, or does it have to be the userid
Possible, above is just an example on how to kill a particular session object. "test" will be the object name, while "124" is the value associated within the session object.

Hope this's clear, cheers :-)
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question