Re: How to Maintain Sessions in Tomcat 4.1?

From: Neerja Tyagi (neerjatyagi_at_netscape.net)
Date: 08/11/04


Date: 11 Aug 2004 02:40:28 -0700

Dear James
 
try to invalidate the session after a specific time interval can solve
your problem as then tomcat will not start a new session unless its
previous session is invalidated.
 
u can achieve this by two ways.
 
either u can declare timeout in the server.xml in conf directory of
tomcat or in your web.xml in webapps u declare the time out. then no
new sessio will be created as long as session is valid.
 
 
neerja

jw697569@hotmail.com (James) wrote in message news:<44050548.0408021318.5698f8e@posting.google.com>...
> I have an application running in Tomcat 3.3. When I request a JSP
> within Tomcat, Tomcat establishes a session and each subsequent JSP I
> visit uses the same session. I don't remember doing anything special
> with Tomcat 3.3 -- it seemed like default Tomcat behaviour to
> establish and maintain a session. This works properly in both IE6 and
> Netscape 6. From a bit of reading, I understand that Tomcat sends a
> session cookie to the browser and that's how it tracks the ongoing
> session.
>
> Now I am trying to migrate the application to work in Tomcat 4.1.30
> (just trying to get the first set of 3 related JSPs working for now).
> I am finding that every JSP page that I visit, Tomcat establishes a
> new session (same IE and Netscape browsers as above that still work
> fine with Tomcat 3.3). I have verified the behaviour by printing out
> the session.getId() each time on each JSP -- and Session Id is always
> different.
>
> I am wondering if there is some default setting in Tomcat 4.1 that is
> keeping it from recognizing subsequent visits by the same browser as
> the same session. I admit that I don't have a deep understanding of
> Tomcat.



Relevant Pages

  • Re: How to invalidate a session?
    ... > I am using invalidate method from the httpSesion class, ... Invalidating a session is server-side logic, ... You might set the appropriate HTTP headers when you send ... Setting these will prevent any non-deaf browser from showing cached content. ...
    (comp.lang.java)
  • Can a client recapture a session in Tomcat 4.1?
    ... Can a client recapture his Tomcat session after he ... I guess I'd need to tell the browser to persist ... Sebastian Millies, IDS Scheer AG ...
    (comp.lang.java.programmer)
  • Re: TOMCAT PROBLEM: Establishing a session
    ... >> Hi I am running Tomcat in standalone mode. ... >> refresh button on my Mozilla browser. ... > What method did you use to determine whether there is a session or not? ... servlet, we have written a second servlet which implements a HashTable ...
    (comp.lang.java.programmer)
  • Re: servlet problems with session attributes
    ... I use session attributes to to preserve data across the ... >> session and to comunicate across servlet objects. ... >> restarting the Tomcat container! ... > one or two jsps and one or two servlets. ...
    (comp.lang.java.programmer)
  • Re: Session Timeout with jsp
    ... > I have a jsp which is called when a session times out wherein I use ... > session.invalidate() method to invalidate the session and display a ... > message to the user to login again as his session has expired. ... the browser caches the credentials, ...
    (comp.lang.java.programmer)