title: Vaadin Session Timeout configurable using preferences
body: <p>I am using Vaadin 8 and add-on plugin to implement Session time out when UI is idle for more than 3 mins. Here is the add-on plugin</p>
  
  <pre><code>&lt;dependency&gt;
     &lt;groupId&gt;org.vaadin.anna&lt;/groupId&gt;
     &lt;artifactId&gt;cleanupservlet&lt;/artifactId&gt;
     &lt;version&gt;2.0.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>VaadinUI.java</p>
  
  <pre><code>@Override
      protected void init(VaadinRequest vaadinRequest) {
  
          // timeout for 3 mins
          VaadinSession.getCurrent().getSession().setMaxInactiveInterval(180);
  
          Responsive.makeResponsive(this);
          setLocale(vaadinRequest.getLocale());
  
          showMainView();
      }
  </code></pre>
  
  <p>VaadinServlet.java</p>
  
  <pre><code>@WebServlet(urlPatterns = "/*", name = "VaadinServlet", asyncSupported = true)
  @VaadinServletConfiguration(ui = VaadinServlet.class, productionMode = false, heartbeatInterval = 180, closeIdleSessions = true)
          public static class VaadinServlet extends CleanupServlet {
  
              @Override
              protected int getCleanupPollingInterval() {
                  // how long to wait between session timeout checks
                  return 2000;
              }
  
              @Override
              protected boolean alwaysCheckUITimeOuts() {
                  // if you want to ensure UI cleanup on every check
                  // regardless of session timeout, default false
                  return true;
              }
          }
  </code></pre>
  
  <p>I dont have web.xml to configure the inactiveInterval. Is there a way to configure the inactiveInterval and heartbeatInterval as given by the user in the Preference Dialog?? </p>
  
  <p>Or is there any way to implement Session Timeout which is configurable by the user??</p>
  
  <p>Any help is appreciated.</p>
  
  <p>TIA</p>