Create a session timeout alert box using the new SessionEntityProvider in entity broker from
SAK-13901. With this, the JS app can poll the server for the current session information to see if the user's session has expired, or to see if it should show the DHTML popup or not. The added bonus of using entity broker is that the polling can happen without actually affecting the session and therefore keeping it alive.
This should be a highly accurate indicator of the current session state.