title: Cakephp CSRF mismatch
body: <p>Following is my <code>AppController.php</code></p>
  <pre><code>public function initialize()
  {
      parent::initialize();
      $this-&gt;loadComponent('Csrf');
      $this-&gt;loadComponent('RequestHandler', [
          'enableBeforeRedirect' =&gt; false,
      ]);
      $this-&gt;loadComponent('Auth', [
          'unauthorizedRedirect' =&gt; [
              'controller' =&gt; 'Users',
              'action'     =&gt; 'login'
          ],
          'storage' =&gt; 'Session'
      ]);
      
      $this-&gt;loadComponent('Flash');
  
      
      /*
       * Enable the following component for recommended CakePHP security settings.
       * see https://book.cakephp.org/3/en/controllers/components/security.html
       */
      //$this-&gt;loadComponent('Security');
  }
  </code></pre>
  <p>and my <code>Application.php</code></p>
  <pre><code> public function middleware($middlewareQueue)
      {
          $options = ['httpOnly' =&gt; true];
          $csrf = new CsrfProtectionMiddleware($options);
          $middlewareQueue            
              -&gt;add(new ErrorHandlerMiddleware(null, Configure::read('Error')))
              -&gt;add(new AssetMiddleware([
                  'cacheTime' =&gt; Configure::read('Asset.cacheTime'),
              ]))
              -&gt;add(new RoutingMiddleware($this))
              -&gt;add($csrf);
  
          return $middlewareQueue;
      }
  </code></pre>
  <p>and the following is my view.</p>
  <pre><code>&lt;form action=&quot;&lt;?= Router::url(['controller' =&gt; 'Users', 'action' =&gt; 'registration']) ?&gt;&quot; method=&quot;POST&quot;&gt;
                              &lt;input type=&quot;hidden&quot; name=&quot;_csrfToken&quot; value=&quot;&lt;?= $this-&gt;request-&gt;getParam('_csrfToken'); ?&gt;&quot; /&gt;
  
  &lt;/form&gt;
  </code></pre>
  <p>Still, when i submit the form it says</p>
  <p><a href="https://i.stack.imgur.com/sfTOa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sfTOa.png" alt="enter image description here" /></a></p>