You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jonathan Carpenter <jo...@gmail.com> on 2016/08/30 17:26:01 UTC

Tomcat8 on CentOS - Session-Tomcat

 I have a Tomcat8 (CentOS 7) question. In web.xml under <session-config>
--> <session-timeout> I seen a post on stackoverflow that you can set this
to -1 to keep the session open until the browser is closed. However I
cannot find this in the documentation. Can anyone verify this or point me
in the correct direction for a documented solution. The issue is after 30
minutes the session times out as configured, but anything over 30 does not
work.

Re: Tomcat8 on CentOS - Session-Tomcat

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jonathan,

On 8/30/16 1:26 PM, Jonathan Carpenter wrote:
> I have a Tomcat8 (CentOS 7) question. In web.xml under
> <session-config> --> <session-timeout> I seen a post on
> stackoverflow that you can set this to -1 to keep the session open
> until the browser is closed. However I cannot find this in the
> documentation. Can anyone verify this or point me in the correct
> direction for a documented solution. The issue is after 30 minutes
> the session times out as configured, but anything over 30 does not 
> work.

See Coty's reply for the -1.

About setting it to more than 30, there are a number of ways that
<session-timeout> could be overridden. You can do it in code, and I
think there are other ways to configure it and I can't remember the
precedence rules.

Can you confirm that the web.xml you are editing is the one actually
being used by Tomcat? Lots of people end up using Eclipse or whatever
that doesn't always do what you expect. Or you forget to copy the
changes into the deployment directory, WAR file, etc.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXxdP7AAoJEBzwKT+lPKRY7pYQAMAwhvxaW3bnfhFDzf/p+lV7
j/TLSmI6g3hcHmNZJjafDKpWDSElh9PudvaO7K4Qispp+l82LYBBQSTFuTUASfZt
Q3lKYkTkQFoMU+rBvqx+ax69XDipNV4BnNmeZrvPUIvfdx8ZME6Ts9udvR5/KKoS
gabZVXHz0TuC/2saabRgqa0n6M4zYEhHUSemPSZJgu6b1Dyv1HLIZR0qS0Qxmplk
ip1NyPNfgsd34V48pKbOF8uHqKbHKQ4EJ6eCHCy7IcTFcZGSjjt3eDbj12DTlXwA
g8gL8b3yYDWxJezwao2W92g9+vlCzV7iwTmvuaTKyfoTP6P9oLwvg+0S1HXIg3BV
8klZB0qYzoc0xTw/7u/X8DLdX28byw4bETbcGrs2oS5z8nGWOzRgzATV4XdlHeGk
vEY5w+eAC56hxFpLxdEptxYCDCsCfoUWTqR1RBerTMzp9bIaPQvs93CZTWuNHL60
+n3oQW2vqrbX5gbouiEWCF5nHOKb2rw1OmSoerSFJhywVv3Xnjs0bau7IZq3rQr7
+KuQ0c66P7LwnfJ3UigaR2VFmvI9SWbdBL4ZwptKdaKEB2O6nL29y8GDep5eaPND
muDvTGPKmSKo5Aazrq7KC5JSkU6qZXeU0R7yMJbqQ8eZ5agOzmvDrT3SO+Z7GE/B
GCrghzu5SPZxFtFUb/7n
=K2pW
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat8 on CentOS - Session-Tomcat

Posted by Coty Sutherland <cs...@redhat.com>.
Just following up on our IRC conversation (which happened after this
email) so others can see my response. I was able to find a description
of the session-timeout setting in the XSD here:
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/javax/servlet/resources/web-common_3_1.xsd?view=markup#l865

The description there states the following:

"If the timeout is 0 or less, the container ensures the default
behaviour of sessions is never to time out."

So if you set it lower than zero, you're letting the session live
forever (even after the browser closes).

On Tue, Aug 30, 2016 at 1:26 PM, Jonathan Carpenter
<jo...@gmail.com> wrote:
>  I have a Tomcat8 (CentOS 7) question. In web.xml under <session-config>
> --> <session-timeout> I seen a post on stackoverflow that you can set this
> to -1 to keep the session open until the browser is closed. However I
> cannot find this in the documentation. Can anyone verify this or point me
> in the correct direction for a documented solution. The issue is after 30
> minutes the session times out as configured, but anything over 30 does not
> work.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org