Extended VaadinServlet that provides a cleanup thread to clear out session when all UIs have been closed, without needing to wait for the session timeout

It's possible to close a browser window in such way that neither UI cleanup nor session cleanup will happen until the underlying http session timeouts. This can happen because the design idea for heartbeat is to keep the UI alive, not to ensure timely cleanup, and as such the default check is only performed at the end of each request.

This add-on adds a cleanup thread for each session for performing this check at regular intervals to make sure the session cleanup definitely happens. There is also an option for checking each UI for timeouts and closing the session if there are no UIs left, even if the session itself would still have time left.

Use version 1.0.0 for Vaadin 7.4+ projects, and version 2.0.0 for Vaadin 8 projects Note: might work on older Vaadin versions too, haven't tested beyond 7.4.0.

If you'd like to get more features or to modify the existing functionality, there's a link to the source code on the side bar -- it's only two classes, so copying them to your own project shouldn't be much of a hassle. Pull requests are also welcome. You can also leave bug reports and feature requests to the issue tracker, or comment on the discussion forum, although I tend to be very busy so I make no guarantees for delivery.

Install

Link to this version
ExperimentalReleased 10 March 2017Apache License 2.0
Framework Support
Vaadin 8.0+
Also supported:
Vaadin 7 (1.0.0)
Install with
Release notes - Version 2.0.0

Upgraded to Vaadin 8