Trap the window close event
<p>I am facing the problem to logout my page. I calls the logout method from the  tag of the page like this</p>

<pre><code>&lt;body onbeforeunload="beforeLogout();" onUnload="logout('/ruxamod/faces/zzrucmpvhs1.xhtml?logout=t');" onclick="hideDescFrame();"&gt;
</code></pre>

<p>but I have no idea how to trap the window close button is clicked because all these methods are call when user refresh the page.</p>

<p>Thanks</p>
