title: How to increase the session life time in cakephp?
body: <p>I am trying to increase the session lifetime in cakephp app. I have a <code>remember me</code> checkbox in login page. When checking the checkbox, I need to extend session time to 1 hour more to current time and any action inside the app after login  will need to extend session time to 1 hour more.</p>
  
  <p>I have component file for login and all action will be entered in <strong>startup function</strong>.
  I tried to extend the <code>session.cookie</code>(CakePHP's session cookie) lifetime, but it didn't works.</p>
  
  <pre><code>function startup(&amp;$controller) {
    /* First try */
    setcookie(Configure::read('Session.cookie'),$_COOKIE[Configure::read('Session.cookie')], time() + 3600, "/"); // Configure::read('Session.cookie') is 'CAKEPHP'.
    /* Second try */
    ini_set('session.gc_maxlifetime', 3600);
    /* Third try */
    session_set_cookie_params(time() + 3600);
  
    echo $this-&gt;Session-&gt;read('status').'   session  &lt;br/&gt;';
    echo $_SESSION['test'];
  }   
  </code></pre>
  
  <p>But all of these doesn't keep the session after <code>session.timeout</code>(CakePHP's session timeout) time. The session <code>status</code> and <code>test</code> varaibles are created on login. It will be retrieved until <code>session.timeout</code> is not reached.</p>
  
  <p>I am using cakephp <strong>v1.2</strong>.</p>