title: Zend Framework 2 CSRF validation
body: <p>I have application base on Zend framework 2. I have a form with CSRF field. If I fill the form and submit after around 5 minutes it gives me <code>The form submitted did not originate from the expected site</code> validation error. </p>
  
  <p>So I assumed it might be some issue with session configurations. Then I added options to <code>SessionConfig</code> on <code>module.config.php</code> as <a href="https://stackoverflow.com/questions/19525329/zend-framework-2-session-life-time">follows</a> </p>
  
  <blockquote>
  <pre><code>'session' =&gt; array(
      'remember_me_seconds' =&gt; 2419200,
      'use_cookies' =&gt; true,
      'cookie_httponly' =&gt; true,
      'cookie_lifetime' =&gt; '2419200',
      'gc_maxlifetime' =&gt; '2419200'
  ),
  </code></pre>
  </blockquote>
  
  <p>But the problem still exist. Do you know how to fix this issue ?</p>
  
  <p>--Update--</p>
  
  <p>My form class contains the CSRF element as follows,</p>
  
  <pre><code>    $this-&gt;add(array(
          'type' =&gt; 'Zend\Form\Element\Csrf',
          'name' =&gt; 'security',
          'options' =&gt; array(
              'csrf_options' =&gt; array(
                  'timeout' =&gt; 20000
              )
          )
      ));
  </code></pre>
  
  <p>None of these seems to work.</p>