title: PHP Session Expiration
body: <p>I have a session that after 30 minutes of inactivity is destroyed or after 23.4 hours is destroyed.</p>
  
  <p>The problem that I have is regardless of activity the session is destroyed after 30 minutes. So if a user is constantly active within the 23.4 hours the session should be maintained for those 23.4 hours then destroyed forcing the user to login again, but the session is destroyed after 30 minutes even though the user is constantly active for those 30 minutes.</p>
  
  <p>Because the Garbage Collector looks at the modified time and not the accessed time the session is being updated with <code>time()</code> so that the modified time is updated when a user does anything on the site.</p>
  
  <p>Here is the php.ini session settings:</p>
  
  <pre><code>Directive                   Local Value     Master Value
  session.cache_expire        30              30
  session.cookie_lifetime     1800            1800
  session.gc_divisor          1000            1000
  session.gc_maxlifetime      84400           84400
  session.gc_probability      1               1
  session.save_handler        files           files
  </code></pre>
  
  <p>If you need any other of the session ini settings let me know.</p>
  
  <p>Any help with this would be greatly appreciated.</p>
  
  <p>Thanks</p>