title: GWT end Http Session on Window close
body: <p>When I close my browser window with my app open, I would like to end the http session as well.
  I have tried <a href="https://stackoverflow.com/questions/2562658/execute-code-on-window-close-in-gwt">Execute code on window close in GWT</a> but anything I place in the onClose method doesn't get run.</p>
  
  <pre><code>Window.addCloseHandler(new CloseHandler&lt;Window&gt;()
      {
  
          @Override
          public void onClose(CloseEvent&lt;Window&gt; event)
          {
              //Code in here never executes!
              alert("Hi");
              Window.Location.replace(GWT.getHostPageBaseURL() + "logout.jsp");
          }
      });
  </code></pre>