title: Zkoss: How to notify user of session timeout or lost connection to server?
body: <p>Is there a way of programmatic checking of session timeout or lost connection when using the zkoss web UI framework? The problem is that even if I shut down the server, redeploy or restart it, the UI will just remain displayed in the browser.</p>
  
  <p>The user will discover that something is wrong only when trying to interact with the UI (e.g. clicks a button). The it either pops up session timeout info or server unreachable info.</p>
  
  <p>What I am looking for is something on the client side that would notify the user right away (or within reasonably short time). Something that, when the session is lost, server goes down or is otherwise inaccessible, will for example show a popup window that  tells the user something is wrong (so he can immediately refresh or take some other action).</p>
  
  <p>I was looking at the docs, but they do not say anything specific for this case. The session settings cover limits, keep-alive to prevent session timeout, but that's it.</p>
  
  <p>I'm considering some custom javascript that would periodically ping the server (maybe a special servlet, that would also let the script know about session timeouts), but I would prefer something native to the zk framework. The zk timer component seems to cease function when the connection is lost, but it does not trigger the error popup.</p>