PHP session destroy on closing the browser
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2839988/destroy-or-unset-session-when-user-close-the-browser-without-clicking-on-logout">Destroy or unset session when user close the browser without clicking on logout</a>  </p>
</blockquote>



<p>I am implementing a chat script for my client. The problem I am facing is, if the user logs out, I can program to end his chat status to offline, as the status is set to 1 when the user logs in, but I am confused about, what if the user close the browser without logging out. In this case the status in the db remains 1 as the user hasn't logged out.</p>

<p>Hope you understand the question. Please help.</p>
