title: How to increase the session lifetime in Symfony2?
body: <p>I have a login with a remember checkbox.
  I'm tring to set lifetime of session to 1 year if the remember checkbox is checked, but no matter what I tried, it doesn't work... Symfony profiler always say that session lifetime is 0.</p>
  
  <p>That's what I tryed in my controller function:</p>
  
  <pre><code>$this-&gt;getRequest()-&gt;getSession()-&gt;set("gesaudit",array("login"=&gt;true,"user"=&gt;$user));
  
  if($remember == "1"){
      $lifetime = new NativeSessionStorage();
      $lifetime-&gt;setOptions(array('cookie_lifetime' =&gt; 31557600));
  }else{
      $lifetime = new NativeSessionStorage();
      $lifetime-&gt;setOptions(array('cookie_lifetime' =&gt; 0));
  }
  </code></pre>