Skip to content

Commit da5113a

Browse files
committed
Merge branch '7.3' into 7.4
* 7.3: fix default CSRF token input name
2 parents bb08518 + 1bd508e commit da5113a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security/csrf.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ to do anything to be protected against CSRF attacks.
119119

120120
.. _form-csrf-customization:
121121

122-
By default Symfony adds the CSRF token in a hidden field called ``_csrf_token``, but
122+
By default Symfony adds the CSRF token in a hidden field called ``_token``, but
123123
this can be customized (1) globally for all forms and (2) on a form-by-form basis.
124124
Globally, you can configure it under the ``framework.form`` option:
125125

@@ -187,7 +187,7 @@ method of each form::
187187
// enable/disable CSRF protection for this form
188188
'csrf_protection' => true,
189189
// the name of the hidden HTML field that stores the token
190-
'csrf_field_name' => '_token',
190+
'csrf_field_name' => 'custom_token_name',
191191
// an arbitrary string used to generate the value of the token
192192
// using a different string for each form improves its security
193193
// when using stateful tokens (which is the default)

0 commit comments

Comments
 (0)