1
votes

I am using Vaadin 7.7.9 and Apache Tomcat 9.0.

My goal is to expire user session after 12 hours, so if the user log on the system at 8am, the session must expire at around 6pm. But the session is expiring between 3.5pm and 4.5pm. Some times session expires after 15-30 minutes.

Why my session is not expiring after 12 hours?

Vaadin servlet parameters on servlet class:

@VaadinServletConfiguration(productionMode = true, ui = 
    com.dokcloud.DokcloudUI.class, heartbeatInterval = -1, closeIdleSessions = true)

On my UI class on init method:

DokcloudUI.getCurrent().getSession()
    .getSession().setMaxInactiveInterval(43200); // 12 hours

The system is being publicised on elastic bean stalk (AWS).

1
Are you using any kind of Push technology? As I vaguely recall, doing so can keep the session active thereby preventing auto-close. That session expiration kicks in only while the session is inactive (quiet) meaning the user is not doing anything. The expiration is not since the session started, only since the last activity by the user (or by Push technology, perhaps). - Basil Bourque
As far as I know, Vaadin 7 is not built to work on Tomcat 9. You ma want to stick with Tomcat 8.5.x. - Basil Bourque
Yes, I'am using @Push annotation provided by vaadin (on automatic mode). Thanks for the answer, i will use tomcat 8.5. So to expire session after 12 hours i must enable heartBeat interval and set it to 14400 (12 hours / 3 in seconds) ? - Ramon Lacava
Traditional session timeout is always based on last activity and not a time of first interaction. You will have to implement this in your own logic in the vaadin session. (Not the servlet session) - André Schild

1 Answers

0
votes

I found the problem a long time ago. It was needed to adjust some timeout parameters in AWS environment.