So the mechanism for handling session expiry when Push requests are active is:
- A ResourceHandler called SessionTimeoutMonitor is active and reviews each incoming request.
- Each incoming request does touch the session, so the SessionTimeoutMonitor detects whether or not the requests is a Push request or not.
- If a the request is a not a Push request, then we create/update a our own synthetic timeout value in the session.
- If a request is a Push request, then we do not modify this sythetic session value.
- Finally, each request looks at the synthetic expiry value and, if the maxInactiveInterval has been exceeded, expires the session programmatically.
What this means is that, if there are ONLY Push requests coming in, the "real" container session will never expire but our synthetic session activity calculation will eventually determine that a request (either Push or non-Push) has occurred that is longer than the maxInactive interval.
Something we should note. Due to the nature of our calculation, our synthetic session expiry could occur up to one "heartbeat" later than an actual session expiry triggered by the servlet container. This is because an incoming Push request could fall just short of actually triggering the synthetic expiry and it would have to wait for the next "heartbeat" to trigger it. Currently, the default "heartbeat" interval for Push is 50 seconds which means that, given a real session timeout of 5 minutes, a synthetic expiry may occur as late as 5 minutes + 50 seconds.
If this is deemed unacceptable, we could potentially mitigate this by:
- doing a more complex calculation and calling setMaxInactiveInterval in order to try and get the servlet container to trigger the timeout at the exact time
- use Filters (Servlet/Portlet 2) to achieve better results (we declined to do this in 1.8 due to the fact that it made the configuration more complex and that there were no filters for Portlets but both of these problems have been somewhat reduced since then)
- discussing other possible solutions
When 'strictSessionTimeout' is enabled I can see "Network Connection Interrupted" indicator showing up when the session expires. On a closer look I can see the "User Session Expired" popup rendered under the "Network Connection Iterrupted" popup. This is due to the decoupling we now have between ICEfaces bridge and ICEpush bridge, the ICEpush bridge has no knowlenge about sessions it just sees the network connection dropped.
Changed session expired indicator to disable connection lost and connection trouble indicators on session expiry.