File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,11 @@ CSRF protection works by adding a hidden field to your form that contains a
1212value that only you and your user know. This ensures that the user - not some
1313other entity - is submitting the given data.
1414
15- Before using the CSRF protection, install it in your project (which in turn
16- requires installing the Symfony Form component):
15+ Before using the CSRF protection, install it in your project:
1716
1817.. code-block :: terminal
1918
20- $ composer require security-csrf form
19+ $ composer require security-csrf
2120
2221 Then, enable/disable the CSRF protection with the ``csrf_protection `` option
2322(see the :ref: `CSRF configuration reference <reference-framework-csrf-protection >`
@@ -278,6 +277,10 @@ After this, you have protected your login form against CSRF attacks.
278277 CSRF Protection in HTML Forms
279278-----------------------------
280279
280+ .. versionadded :: 4.1
281+ In Symfony versions prior to 4.1, CSRF support required installing the
282+ Symfony Form component even if you didn't use it.
283+
281284It's also possible to add CSRF protection to regular HTML forms not managed by
282285the Symfony Form component, for example the simple forms used to delete items.
283286First, use the ``csrf_token() `` function in the Twig template to generate a CSRF
You can’t perform that action at this time.
0 commit comments