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

marielle.spiteri
Blog Categories: 

Component: Bonita WidlFly | Version: 7.4.x to 7.9.x

Note: For the Tomcat bundle, please consult this page: How to increase the session and engine timeout in Bonita Tomcat Bundle Version 7

Question: How to increase the session and engine timeout in 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.9/user-authentication-over...). 2 different values would lead to unexpected behavior...

Resolution

1. Updating the HTTP Session in Bonita WildFly Bundle

a. Stop WildFly server with the following command: /server/bin/jboss-cli.[bat|sh] --connect --command=:shutdown

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

c. Edit setup/wildfly-templates/standalone.xml file.

d. Find the line inside the section, and add a default-session-timeout parameter with your value (in minutes, i.e: <servlet-container name="default" default-session-timeout="60"> ) at your convenience, for example:

<subsystem xmlns="urn:jboss:domain:undertow:3.1">  
    <buffer-cache name="default" />  
    <server name="default-server">  
        <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true" max-post-size="104857600" />  
        <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true" />  
        <host name="default-host" alias="localhost">  
            <location name="/" handler="welcome-content" />  
        </host>  
    </server>  
            <servlet-container name="default" default-session-timeout="60">  
        <jsp-config />  
        <websockets />  
        <session-cookie name="SESSIONID" />  
    </servlet-container>  
    <handlers>  
        <file name="welcome-content" path="${jboss.home.dir}/welcome-content" />  
    </handlers>  
</subsystem>

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

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

2. Updating the Bonita Engine Session in Bonita WildFly Bundle

This session is created by Bonita Engine on the Bonita Portal request, 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 Bonita version 7.4.x up to 7.9.x

a. Stop WildFly server with the following command: /server/bin/jboss-cli.[bat|sh] --connect --command=:shutdown

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. Start the WildFly server with command: Run start-bonita.[bat|sh]

Notifications