Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 51493 invoked from network); 15 Feb 2001 23:41:29 -0000 Received: from unknown (HELO exchange.cendex.com) (63.70.253.45) by h31.sny.collab.net with SMTP; 15 Feb 2001 23:41:29 -0000 Received: by exchange.cendex.com with Internet Mail Service (5.5.2650.21) id <1583WQ52>; Thu, 15 Feb 2001 18:41:31 -0500 Message-ID: From: Melissa Matthews To: tomcat-user@jakarta.apache.org Subject: Problems with session variables Date: Thu, 15 Feb 2001 18:41:23 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N I am using Tomcat 3.2. I seem to be losing some of the session variables (or keeping old values) between JSP pages. I have even tried removeAttribute to remove the old values and then setAttribute to save the ones. Some of them are saved, but not others. Here is the segment where I save the variables ====> // Remove the old values from the session String oldValue = (String)session.getAttribute("person_id"); if ( oldValue != null ) { session.removeAttribute("person_id"); } oldValue = (String)session.getAttribute("firstName"); if ( oldValue != null ) { session.removeAttribute("firstName"); } .... // Add the new session values session.setAttribute("person_id",person_id); session.setAttribute("firstName",firstName); Here is where I retrieve the values ===> session = request.getSession(false); String person_id = (String)session.getAttribute("person_id"); if ( person_id != null ) { String firstName = (String)session.getAttribute("firstName"); if ( firstName != null ) { ...... } } The person_id is correct, but the name remains the old name. I have tried encoding the URL, initializing the session etc. Any suggestions?