title: how to kill a application session when a browser window is closed?
body: <p>i have a problem.  </p>
  
  <p>I am working on a chatting application. I want to kill the session if user closes the browser window without logging off. I used 'beforeunload' function but it also fires when  a postback event is fired so it's not good for me.  </p>
  
  <p>Please help if anyone have any idea about it.</p>