title: Symfony2 sessions not working as expected / session keeps timing out
body: <p>My Symfony2 application displays a main page, and from there on it primarily uses AJAX requests to display content to the user via modals.</p>
  
  <p>I've noticed that after the user is idle for some period of time (around 15-30 minutes) the session is destroyed, and the user is logged out and needs to log in again. This is incredibly frustrating, since I can't expect users to log in again every time they've been idle for a few minutes.</p>
  
  <p>As far as I can tell, this problem should not be happening according to my <code>config.yml</code> file, which is as follows:</p>
  
  <pre><code>framework:
      session:
          cookie_lifetime: 0      # Session lifetime in seconds
          gc_maxlifetime: 28800   # Seconds after which data will be seen
                                  # as garbage and potentially cleaned up
          handler_id:  ~          # Current using the default session handler
  </code></pre>
  
  <p><br/></p>
  
  <p>For completeness, my current environment is as follows:</p>
  
  <ul>
  <li>Symfony 2.4.8</li>
  <li>PHP 5.4</li>
  <li>Session handler: default (file-based according to <code>php.ini</code>)</li>
  <li>Ubuntu Server 12.10</li>
  </ul>
  
  <p><br/></p>
  
  <p>Summary:</p>
  
  <ul>
  <li><strong>What should be happening:</strong> users should not be logged out, even after being idle for hours</li>
  <li><strong>What is actually happening:</strong> users are being logged out after being idle for 15-30 minutes</li>
  </ul>
  
  <p><br/></p>
  
  <p>How can I fix this?</p>