title: Symfony 2: How to set the session lifetime at login?
body: <p>I have a custom login form for my Symfony 2 application. In this form I have a choice field with multiple options to set the max idle time of the login session. I want to be able to set the session lifetime at the login action. Unfortunately the loginaction is stored in the FOSUserBundle which can not be modified cause of future updates of the bundle.</p>
  <p>This is what I found out so far, correct me if I am wrong:<br />
  First the lifetime in symfony can be destroyed after a period of time, as described <a href="http://symfony.com/doc/current/components/http_foundation/session_configuration.html#session-idle-time-keep-alive" rel="nofollow noreferrer">here</a>.</p>
  <p>Second I have to be able to catch/intercept the login action/validation to set a parameter in parameter.yml.</p>
  <p>The parameter then can be used in a listener to check if the maxlifetime isn't exceeded.</p>
  <p>So my question is split in two other questions:</p>
  <ol>
  <li>How do I catch/intercept the login action/validation?</li>
  <li>Is there a way to create a listener that checks the idle time while nothing happens (or can there be check on the next request)?</li>
  </ol>