title: How do I make session in CakePHP infinite (or at least longer even when inactive)?
body: <p>I'm using CakePHP 2.4.3 and right now, it's logging me out after about 30 minutes of being inactive. I want the session to last longer (or infinite if possible like Facebook) <em>even when I leave the site (not closing the browser)</em> for a couple of hours or so.</p>
  
  <p>I've tried the following on app/Config/core.php but none of these ever worked:</p>
  
  <p><strong>Test #1:</strong></p>
  
  <pre><code>Configure::write('Session', array(
          'defaults' =&gt; 'php',
          'timeout' =&gt; 60, // The session will timeout after 60 minutes of inactivity
          'cookieTimeout' =&gt; 4320, // The session cookie will live for at most 3 days, this does not effect session timeouts
          'checkAgent' =&gt; false,
          'autoRegenerate' =&gt; true, // causes the session expiration time to reset on each page load
      ));
  </code></pre>
  
  <p><strong>Test #2:</strong></p>
  
  <pre><code>Configure::write('Session', array(
          'defaults' =&gt; 'php',
          'timeout' =&gt; 2160, // 36 hours
          'ini' =&gt; array(
              'session.gc_maxlifetime' =&gt; 129600 // 36 hours
          )
      ));
  </code></pre>
  
  <p><strong>Test #3:</strong></p>
  
  <pre><code>Configure::write('Session', array(
              'defaults' =&gt; 'php',
              'cookieTimeout' =&gt; 0
      ));
  Configure::write('Security.level', 'medium');
  </code></pre>
  
  <p>I'm not sure now what's going on when the script on the cakephp site itself doesn't work (Test 2). I log in, check other sites then get back to it after an hour then it's logged out. How do I make session in CakePHP infinite (or at least longer even when inactive)?</p>