title: Why PHP session is deleted on page reload?
body: <p>So I've this problem that, when I'm on the page not doing anything for some time, after I reload the page <code>$_SESSION</code> is cleared. I checked the code and it does not have any <code>unset()</code> functions or anything else what could clear the <code>$_SESSION</code> variable.
  Any ideas why is it happening?</p>
  
  <p><strong>Edit:</strong> In case if I want to make the session live till the browser is closed what should I do? I don't understand it as the <code>gc</code> checks if session is expired on <code>session_start</code>, but I can't modify the session data before calling <code>session_start</code>, so modifying the session data after calling <code>session_start</code> would result in expired session anyway?</p>
  
  <p>I've the <code>session.cookie_lifetime</code> set to 0 by default, <code>session.gc_maxlifetime</code>, <code>session.gc_divisor</code>, <code>session.gc_probability</code> are set to their default values too.</p>