简体   繁体   中英

Spring Boot and Vaadin 7 - setting session timeout has no effect

I am using Vaadin 7.3.9 with Spring Boot 1.2.1.RELEASE and I would like to set session timeout for my application to 15 minutes.

Right now I am doing following:

In application.properties

#session timeout in seconds
server.sessionTimeout=900

In Vaadin Servlet configuration:

@VaadinServletConfiguration(productionMode = false, ui = AppUI.class, closeIdleSessions = true)
public class AppServlet extends VaadinServlet {
}

And after that I make a bean from it:

@Configuration
public class ServletConfiguration {
  @Bean
  public ServletRegistrationBean vaadin() {
    return new ServletRegistrationBean(new AppServlet(), "/app/*", "/VAADIN/*");
  }
}

Also I am following the rule from Book of Vaadin

The session timeout should be longer than the heartbeat interval or otherwise sessions are closed before the heartbeat can keep them alive.

I don't set this parameter so the default value is applies (again from Book of Vaadin ):

The interval of the heartbeat requests can be specified in seconds with the heartbeatInterval parameter either as a context parameter for the entire web application or an init parameter for the individual servlet. The default value is 300 seconds (5 minutes).

Unfortunately, after 15 minutes the application is still alive. What am I doing wrong?

I managed to find out myself what was wrong. I am using progress bar in my application, so I had polling interval set globally. Turning it on just before the progress occurs and off when the job is done is enough - no need to keep it on all the time.

This means that above code does what I expect it to do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM