title: Codeigniter 3 destroy session on browser close
body: <p>I know there are a lot of questions about "How to destroy the codeigniter session on browser close". But trust me no solution work on not perfect solution like calling ajax request on window unload type.</p>
  
  <p>Is someone have perfect solution for this, i have below configuration for session in config file.</p>
  
  <pre><code>$config['sess_driver'] = 'files';
  $config['sess_cookie_name'] = 'ci_session';
  $config['sess_expiration'] = 0;
  $config['sess_save_path'] = NULL;
  $config['sess_match_ip'] = FALSE;
  $config['sess_time_to_update'] = 300;
  $config['sess_regenerate_destroy'] = FALSE;
  </code></pre>