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-timeout-bonita-wildfly-bundle-version-7*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]