title: JSF p:remoteCommand and javascript event onbeforeunload
body: <p>We have several web applications a user can login. On click on logout button some logic must be processed. The problem is that most users close the browser without clicking on logout button. I tried the following to call my logic on browser close:</p>
  
  <ol>
  <li>Added the event "onbeforeunload" to my frameset. On browser close a logout function will be called.</li>
  <li>Within my logout function I use the primefaces p:remoteCommand component to call a action listener on the server.</li>
  </ol>
  
  <p>In current firefox version everything works fine but I have some problems with IE9. Closing a tab in IE9 calls my logic. Closing the browser doesn´t work. My JS function is called but the request to the server is not executed. Is there any way to solve this problem? BTW: I know that this is not an 100% solution but we need exactly this functionality. My function and p:remoteCommand looks like that.</p>
  
  <pre><code>function automaticLogout() {
      handleAutomaticLogout();
      alert('BlaBla');
  }
  
  &lt;p:remoteCommand name="handleAutomaticLogout" actionListener="#{myBean.handleAutomaticLogout}" async="false" /&gt;
  </code></pre>