title: Auto logout if browser is closed
body: <p>I have a requirement like, if user closes browser then upon the next access of the site user should be asked to login again: I have written the following code in <strong><code>.htaccess</code></strong> file which is working fine:</p>
  
  <pre><code>&lt;IfModule mod_php5.c&gt;    
      #Session timeout    
      php_value session.cookie_lifetime 1200    
      php_value session.gc_maxlifetime 1200    
  &lt;/IfModule&gt;    
  </code></pre>
  
  <p>I am excited to know am I doing the correct thing, or is there any other best way to do this? </p>