Session timeout

Hi,

In my environment (CUBA 6.10.16, Jetty webserver built using uberJar), the session does never timeout. My related config is

web-app.properties:

# Web session inactivity timeout in seconds
cuba.httpSessionExpirationTimeoutSec = 600

in app.properties (core module)

#https://www.cuba-platform.com/discuss/t/session-timeout/7664
cuba.userSessionExpirationTimeoutSec = 600

I set the log level to debug in order to see if there is any useful information in the log, but there is no activity from yesterday 8:16 until today 6:37, when I confirmed that the session was still valid.

08:15:32.694 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'com.haulmont.cuba.gui.logging.UIPerformanceLogger' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.694 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'org.xlsx4j.jaxb.Context' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.695 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'com.haulmont.cuba' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.695 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'com.haulmont.cuba.web.sys' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.695 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'com.haulmont.cuba.core.sys' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.695 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'com.haulmont.cuba.core.app.LockManager' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.695 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'com.haulmont.cuba.portal' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.695 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'org.docx4j.utils.ResourceUtils' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.696 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'org.hibernate' set to 'INFO' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.696 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'com.haulmont.cuba.core.sys.CubaDefaultListableBeanFactory' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:15:32.696 INFO  c.h.c.web.jmx.JmxRemoteLoggingBean - Level for logger 'com.haulmont.restapi.sys' set to 'DEBUG' on '<local> (ad0a923ddde1:<unknown-port>)'
08:16:04.633 INFO  c.h.c.s.a.AuthenticationManagerBean - Logged out: fab60aa7-b66c-6543-411d-28291fdcd428 [admin]
08:16:08.915 INFO  c.h.c.s.a.AuthenticationManagerBean - Logged in: 9f87870d-66f6-fa76-47ba-abc97b26a5e7 [admin]
06:37:55.446 WARN  c.h.c.g.ControllerDependencyInjector - CDI - Unable to find an instance of type 'interface com.haulmont.cuba.gui.components.Button' named 'addGhsButton' for instance of 'com.company.helium.web.substance.SubstanceEdit'
06:37:58.726 INFO  c.h.c.s.a.AuthenticationManagerBean - Logged out: 9f87870d-66f6-fa76-47ba-abc97b26a5e7 [admin]

Is there any problem with my config or any workaround to make it work ? Is there a schedule task that I have to enable in order to expire the sessions ?

Thanks !

Alejandro

Hi,
By default there is a heartbeat which constantly pings web session from the browser, preventing the session to be expired if user has web client opened the browser.

Take a look at these properties:
https://doc.cuba-platform.com/manual-7.2/app_properties_reference.html#cuba.web.uiHeartbeatIntervalSec

https://doc.cuba-platform.com/manual-7.2/app_properties_reference.html#cuba.web.closeIdleHttpSessions

1 Like

Thanks ! It works now, setting the cuba.web.closeIdleHttpSessions property to true