You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Armin Pfarr <ap...@vipsurf.de> on 2000/02/21 18:15:53 UTC

Session-Timeout

Hi,

I'm using Tomcat 3.01 and couldn't yet enable a session-timeout

I added the lines

    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>

to my web.xml-file, but still the session gets thrown away after
approximately 2 minutes


Any idea?

Armin


Re: Session-Timeout

Posted by John Thorhauer <jt...@phoenixcolor.com>.
Armin Pfarr wrote:
> 
> I added the lines
> 
>     <session-config>
>         <session-timeout>
>             30
>         </session-timeout>
>     </session-config>
> 
> to my web.xml-file, but still the session gets thrown away after
> approximately 2 minutes

You can set your timeout like this:

int timeout = 3600; // 30 minutes
HttpSession session = request.getSession(true);
session.setMaxInactiveInterval(timeout);


You can check your timeout like this:
session.getMaxInactiveInterval()

-- 
********************************
** John Thorhauer
** Web Developer
** jthorhauer@phoenixcolor.com
********************************

Re: session tracking

Posted by John Thorhauer <jt...@phoenixcolor.com>.
> HttpSession session = request.getSession(); (for JSDK2.1)
> produces new sessions even there is a valid session open.

I have the same problem.  isNew() always returns true even if the
session has been established.  I can create a session in one servlet/jsp
page and then add attributes to it.  I then point it to another
servlet/jsp page within the same web application and create a session
and the isNew() returns true as well.  However, I can still retrieve the
attribute that were set on the previous servlet.  How can the session be
new if it is carrying the attributes that were previously set and a new
servlet/jsp can access it?

John

-- 
********************************
** John Thorhauer
** Web Developer
** jthorhauer@phoenixcolor.com
********************************

session tracking

Posted by Christopher Frauenberger <f_...@gmx.net>.
Hi,

ive posted it a few days ago but got no answer and couldnt imagin that
nobody got this problem too where i am stucked in now for a week.
Once again, the code :
HttpSession session = request.getSession(); (for JSDK2.1)
produces new sessions even there is a valid session open.
This just occurs when i connect via Apache's mod_jserv, if i connect
directly to tomcat everything is just fine. Ive tried it with various
combinations of Jserv and tomcat Versions but nothing seems to help.
It looks like that the connection looses the cookie or its parameters.

Thanks for help 
Christopher

-- 
Sent through Global Message Exchange - http://www.gmx.net


Re: Session-Timeout

Posted by Mike Engelhart <me...@earthtrip.com>.
Christopher Frauenberger wrote:

> Hi,
> 
> Set the defaultSessionTimeOut in the server.xml configuration file.
> e.g.:
> <Context path="/" docBase="webpages"
> defaultSessionTimeOut="30" isWARExpanded="true"
> isWARValidated="false" isInvokerEnabled="true"
> isWorkDirPersistent="false"/>
> 
> It works fine with my context.
> Hope it helps
> Christopher
Hmmm... In 3.1M1 i also have the problem the original poster mentioned and
have to explicitly set the timeout value in my servlet code or else it just
times out after 2 minutes.  I have my server.xml with this;
defaultSessionTimeOut="1800"

and it still times out in 2 minutes (I put valueUnbound() methods in my
classes to check that this was happening).  Definitely a bug. I've tried it
on 3 different platforms and JVM's and they all exhibit this behavior.\

Mike


Re: Session-Timeout

Posted by Christopher Frauenberger <f_...@gmx.net>.
Hi,

Set the defaultSessionTimeOut in the server.xml configuration file.
e.g.:
         <Context path="/" docBase="webpages"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false"/>

It works fine with my context.
Hope it helps
Christopher

-- 
Sent through Global Message Exchange - http://www.gmx.net