How to increase the session and engine timeout in Bonita Tomcat Bundle Version 7

marielle.spiteri's picture
marielle.spiteri
Blog Categories: 

Component: Bonita Tomcat | Version: 7.3+

Question: How to increase the session and engine timeout in Bonita Tomcat Bundle Version 7


Note: for WidlFly Bundle, please consult this page: https://community.bonitasoft.com/blog/how-increase-session-and-engine-ti...

Answer

Two type of session are involved when using Bonita Portal:

1 - The HTTP session
2 - The Bonita Engine session

Warning: The session timeout values for these two sections should be set to the same value (https://documentation.bonitasoft.com/bonita/7.8/user-authentication-overview). 2 different values would lead to unexpected behavior...

Resolution

1. Updating the HTTP Session in Bonita Tomcat Bundle

a. The HTTP tomcat session timeout can be updated in the following file:

Bonita version lower than 7.4.x: /conf/web.xml
Bonita version 7.4.x or higher: /server/conf/web.xml

b. Find the following line and update the value:

<session-timeout>60</session-timeout>

c. Restart the Tomcat.

2. Updating the Bonita Engine Session in Bonita Tomcat Bundle

  • This session is created by Bonita Engine on the Bonita Portal call, when the user submits a login page.

  • Session expiration: If the Engine session has expired and the user tries to reach one of the Bonita Portal pages, an exception will be raised. Bonita Portal will catch this exception, invalidate the HTTP session and redirect the user to the login page. The Bonita Engine default session duration is one hour (default value defined in SessionServiceImpl).

  • You can configure a different session duration by editing the bonita.tenant.session.duration property in the file bonita-tenant-community-custom.properties. Specify the duration in milliseconds:

For BonitaBPM version lower than 7.3.x

a. Update bonita.tenant.session.duration:

- Before the platform is created, edit the file and uncomment the property bonita.tenant.session.duration: /engine-server/conf/tenants/template/bonita-tenant-community-custom.properties

- For an already existing tenant, edit the file: /engine-server/conf/tenants/TENANT_ID/bonita-tenant-community-custom.properties

b. Find the following lines and uncomment the bonita.tenant.session.duration property and set the value at your convenience (3600000 --1 hour-- is the default value):
## Session service
## Session duration in ms
bonita.tenant.session.duration=3600000

For Bonita version 7.3.x

a. Stop Tomcat server with the command: Run bonita-stop.[sh|bat]

b. Run the setup tool to retrieve the latest configuration: Run setup.[sh|bat] pull

c. Edit the files:

- Before the platform is created: /setup/platform_conf/initial/tenant_template_engine/bonita-tenant-community-custom.properties

- For an already existing tenant: /setup/platform_conf/current/tenants//tenant_engine/bonita-tenant-community-custom.properties

d. Uncomment the bonita.tenant.session.duration property and set the value at your convenience (3600000 --1 hour-- is the default value):
## Session service
## Session duration in ms
bonita.tenant.session.duration=3600000

e. Run the setup tool to push the updated configuration: Run setup.[sh|bat] push

f. Restart the Tomcat server with command: Run bonita-start.[sh|bat]

For Bonita version 7.4.x and higher

a. Stop Tomcat server with the command: Run bonita-stop.[sh|bat]

b. Run the setup tool to retrieve the latest configuration: Run setup.[sh|bat] pull

c. Edit the files:

- Before the platform is created: /setup/platform_conf/initial/tenant_template_engine/bonita-tenant-community-custom.properties

- For an already existing tenant: /setup/platform_conf/current/tenants//tenant_engine/bonita-tenant-community-custom.properties

d. Uncomment the bonita.tenant.session.duration property and set the value at your convenience (3600000 --1 hour-- is the default value) :
## Session service
## Session duration in ms
bonita.tenant.session.duration=3600000

e. Run the setup tool to push the updated configuration: Run setup.[sh|bat] push

f. Restart the Tomcat server with command: Run bonita-start.[sh|bat]

Comments

Submitted by jmiralles_1385549 on Tue, 12/03/2019 - 08:21

Please, include this post in the Official Documentation of Bonita.
And, if it's possible, adapt it to Wildfly Bundle.

Submitted by delphine.coille on Tue, 03/10/2020 - 10:28

Hola jmiralles_1385549, you can find the link of the related article with Wildfly bundle HERE. Everything will be included in Bonita official documentation soon.

Submitted by the.shirini on Fri, 08/13/2021 - 21:48

Very Useful thanks a lot. thumbs_up.png

Notifications