title: CSRF in Mautic - Invalid CSRF Token Error
body: <p>I get this error every time I try to do anything in Mautic, e.g. Save a form, change password, etc. I have just migrated and updated Mautic into a new environment, based on the official mautic/mautic image from Dockerhub. I also changed the domain name.</p>
  
  <p>Correct error message:
  <code>
  CSRF token error. Try to refresh the page and try again.
  </code></p>
  
  <p>Here are some things I've tried to fix this:</p>
  
  <ol>
  <li>Clear cache</li>
  <li>Change username and password of the admin user, clear cache</li>
  <li>Added <code>session.save_path = /var/php_sessions/</code> to php.ini, clear cache</li>
  <li>Delete browser cookies, clear cache</li>
  <li><code>php app/console mautic:update:find</code></li>
  <li><code>php app/console mautic:update:apply</code></li>
  <li><code>php app/console doctrine:migration:status</code></li>
  <li><code>php app/console doctrine:migration:migrate</code></li>
  <li><code>php app/console doctrine:schema:update --dump-sql</code></li>
  <li><code>php app/console doctrine:schema:update --env=prod --force</code></li>
  <li><code>php app/console cache:clear</code> * 1000 times</li>
  <li>Checked <code>mymautic.com/s/sysinfo</code> for error messages(fixed all errors)</li>
  <li>Checked folder permissions, all green in the <em>Folder &amp; File Permissions</em> tab</li>
  <li>Delete cache directory</li>
  </ol>
  
  <p>Yes, kind of some tricks ol' Google tipped me about. Now I'm out of ideas.
  Or maybe 2 ideas left, because I changed the domain name, the CSRF-token is not happy :( how do I fix?</p>
  
  <p>Or, Because I'm using Nginx as a loadbalancer so that the CSRF token gets lost on the way(But I was using the same setup before ).</p>
  
  <p>Been trying to solve this for like 5 hours now, going mad. Gonna take a break from that now and hopefully some fellow stackoverflower has some nice brainstorming ideas.</p>