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.
The form is rendered as expected. It contains both my url field and title field. Inside the form the hidden input field _token is also rendered.
When submitting this form, i am getting all the time the following error:
The CSRF token is invalid. Please try to resubmit the form.
So the token is added to the form, it contains a value, i have a constant PHP session cookie value, it is just that this token invalid.
I have searched for other answers but the similar questions are all caused by the absence of a _token input.
This problem also occurs in Symfony 3.0.2/3.0.3.
In my case it was that the
var/sessions/
folder wasn't writable. The default is var/sessions which is set at config.yml.Make sure you have
var/ folders
writable.