Thanks for the response.

I believe that just controls the timeout of the session on the server, and
maybe the timeout of the cookies. To be more specific, I am asking about the
timeout of the jsessionid cookie on the client. Is it possible to control
these separately, i.e., set session-timeout to 30 minutes, but make the
jsessionid cookie expire when the browser is closed, or alternatively, make
the cookie expire in 30 minutes, so the user could close his browser, and
come back to the app later and still maintain his session.

The difference between the types of cookies I am talking about I think are
actually called "browser-session cookies", which means that the browser
keeps the cookies in memory for the life of the browser, or in the second
case, writes them to disk for retrieval later.

Ian.

-----Original Message-----
From: Sean Dockery [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 04, 2003 5:29 PM
To: Tomcat Users List
Subject: Re: Sessions across browser restarts

In your web.xml file, add the following block:

<webapp>

   ...

<!-- Define the default session timeout for your application,
          in minutes.  From a servlet or JSP page, you can modify
          the timeout for a particular session dynamically by using
          HttpSession.setMaxInactiveInterval(). -->

     <session-config>
       <session-timeout>30</session-timeout>    <!-- session times out 
after 30 minutes -->
     </session-config>

   ...

</webapp>

As indicated in the comments, check the documentation for 
HttpSession.setMaxInactiveInterval.  The documentation states that a 
negative value indicates that the session does not timeout (though 
according to BEA WebLogic documentation, -2 means to use the session 
descriptor declared in the weblogic.xml (aka server.xml) file.

At 14:09 2003-02-04, you wrote:
>In Tomcat 4.0, is it possible to configure if a session is lost when the
>browser window is closed, or if the user's session persists across browser
>restarts?
>
>In some other languages, it was possible to take the session cookies and
set
>their timeout to a value of 0 or -1 and this would make the cookies get
>cleared when the browser window was closed. How do you configure this in
>Tomcat?
>
>Ian.

Sean Dockery
[EMAIL PROTECTED]
Certified Java Web Component Developer
Certified Delphi Programmer
SBD Consultants
http://www.sbdconsultants.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to