title: Reset $_SESSION expiration timer on page load
body: <pre><code>ini_set('session.cookie_lifetime', 259200);
  ini_set('session.gc_maxlifetime', 259200);
  session_start();
  </code></pre>
  
  <p>I have the above bit of code included on every single page on my site. I want to keep the user logged in for three days after logging in, but if they visit the site before the expiry date, it keeps them alive for three more days. Basically, the session is kept alive three days from when they leave the site (and if they don't return within those three days).</p>
  
  <p>I've noticed, however, that sessions are kept alive for about a day and then die despite the <code>ini_set</code> I have above. I considered that perhaps it was my webhost's php.ini, but it also does this on my local machine.</p>
  
  <p>Is there some other <code>ini_set</code> call I can do to get my desired effect? These don't seem to work, although they do keep it alive for one day.</p>