I’m using Symfony 2.1 to build a website with a little login form. I’m following the tutorial at this link but I don’t see any part talking about the CSRF protection. However, here there are all the options for the login security and at the end I can clearly see that that type of protection should be supported. I don’t understand how to use it
Share
Here you can read in details about CSRF protection in version 2.1
In case if you don’t use form classes for your forms, you can simply use
csrf_tokenfunction (don’t forget to pass your intention string there, which is empty by default):It is defined here and in default cases will execute this method.
May be these answers might be useful for you also:
https://stackoverflow.com/a/12054712/970721
https://stackoverflow.com/a/11632713/970721