Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JBoss Session Timeout

I'm trying to write the part of my app so that it handles session timeouts gracefully, but I can't seem to control how the duration of time before a timeout occurs for testing.

I am using JBoss 5.1, and I am modifying the session-config my web descriptor (web.xml) such that the session times out after a minute (just for testing)

<session-config>
  <session-timeout>1</session-timeout>
</session-config>

But after creating a session by logging in, it never times out. No setting that I give it causes a timeout.

In a tomcat environment, I haven't had this problem. Has anyone had a similar problem with JBoss?

like image 365
Rydell Avatar asked Jul 07 '10 17:07

Rydell


People also ask

What is JBoss default timeout?

The default JBoss transaction timeout is 300 seconds.

How do I increase my JBoss server timeout?

To increase the transaction timeout: Go to the <JBdir>/server/atg/conf/jboss-service. xml file. Change the <attribute name="TransactionTimeout">300</attribute> to a higher number.

What is blocking timeout in JBoss?

blocking. timeout as a system property to tune the timeout (seconds) waiting for service container stability. The default is 300 seconds. See the solution Add/remove/update system properties in JBoss EAP 6/7 for how to set system properties in JBoss EAP in various modes of operation.

What is server session timeout?

Session timeout represents the event occuring when a user does not perform any action on a web site during an interval (defined by a web server). The event, on the server side, changes the status of the user session to 'invalid' (ie.


2 Answers

JBoss 5 allows you to define a session timeout for all applications at:

deployers/jbossweb.deployer/web.xml

It may be that is overriding your settings in web.xml. It shouldn't, but, you know...

Check if changing that is working. If not, you can set up the timeout programatically for your test:

HttpSession.setMaxInactiveInterval(int seconds)

That way you can force the timeout in a particular session.

like image 176
Pere Villega Avatar answered Sep 22 '22 04:09

Pere Villega


Sadly in JBoss EAP 6.1.0.Alpha1 (AS 7.2.0.Alpha1-redhat-4) we're back to having to set it per web app in web.xml: See the JBoss docs.

Which say use this:

<session-config>
    <session-timeout>30</session-timeout>
</session-config>
like image 45
RedYeti Avatar answered Sep 25 '22 04:09

RedYeti