title: Unset Session When browser tab is closed
body: <p>Where user enters the website, it sent a default language, at the same time it will force the user to select a language from a list...<br>
  When user selects a language it sets a $_SESSION['language'] = $_POST['lg'];<br>
  At the same time I set another $_SESSION['sestime'] = time();<br> with this session I can do this:<br></p>
  
  <pre><code>if(isset($_SESSION['sestime']) &amp;&amp; (time() - $_SESSION['sestime'] &gt; 600)) {
  session_unset(); session_destroy();
  header("Location: $sred");
  exit;
  }
  $_SESSION['sestime'] = time();
  </code></pre>
  
  <p>With that if there are no activity within 10min it destroy/delete/unset any session, the idea is to ask again for the lanaguage... now, this is "working", but what I'd like is away to "detect" when user is about to close a browser tab, the websites tab... if users close the tab then "destroy/delete/unset" any session for this website...
  <br>
  Is that possible?</p>