Session Timeout and HeartBeat


I have been working with session management in my VAADIN application and I have been having a few doubts in it.

I can understand that Session Timeout is the allowed period of inactivity in an application, after which the session expires. But, I am not able to understand how session timeout and heartbeat works together. And also, How would setting “closeIdleSessions” to “true” in web.xml work with session timeout or heartbeat.
Can someone help me with these concepts ?


If closeIdleSessions is true, heartbeats will not extend the session, only user actions. Then the idle (meaning without user interaction) session will expire after timeout.
If closeIdleSessions is false, heartbeats will extend the session. If heartbeat interval is less then session timeout, the session will never expire while the browser tab is open and the connection is working.