title: How to clear session on closing the browser tab?
body: <p>Hi I'm trying to clear all the session variables when the user closes the tab,
  I have tried the following</p>
  
  <pre><code>session_set_cookie_params(0);
  session_start();
  </code></pre>
  
  <p>but it clears the session only when the user closer the entire browser,
  I have tried searching frome some links but I have found that not working.</p>