Symfony 3.0.1 CSRF token present but invalid

前端 未结 7 2468
刺人心
刺人心 2021-02-14 09:33

I am having this strange issue with a fresh Symfony 3.0.1 installation. I generated a new CRUD Controller with a Form PostType which contains an url and a title. Nothing fancy.<

7条回答
  •  忘了有多久
    2021-02-14 10:16

    I just had a similar issue with Symfony 3.2

    The CSRF token is invalid. Please try to resubmit the form.

    After hours, we finally found the issue was related to session.cookie_secure (https):

    Our production environment uses https, thus forces cookies to be secured over https. The dev environment used http. After moving the dev from HTTP to HTTPS, problem was fixed.

提交回复
热议问题