File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -1776,6 +1776,8 @@ The CSRF token can be customized on a form-by-form basis. For example::
1776
1776
// ...
1777
1777
}
1778
1778
1779
+ .. _form-disable-csrf :
1780
+
1779
1781
To disable CSRF protection, set the ``csrf_protection `` option to false.
1780
1782
Customizations can also be made globally in your project. For more information,
1781
1783
see the :ref: `form configuration reference <reference-framework-form >`
Original file line number Diff line number Diff line change @@ -227,8 +227,11 @@ enabled
227
227
228
228
Whether or not to enable support for the Form component.
229
229
230
- You will also have to disable form support if you want to
231
- :ref: `disable the validation support <validation-enabled >`.
230
+ If you don't use forms, setting this to ``false `` may increase your application's
231
+ performance because less services will be loaded into the container.
232
+
233
+ If this is activated, the :ref: `validation system <validation-enabled >`
234
+ is also enabled automatically.
232
235
233
236
csrf_protection
234
237
~~~~~~~~~~~~~~~
@@ -241,9 +244,12 @@ enabled
241
244
**type **: ``boolean `` **default **: ``true `` if form support is enabled, ``false ``
242
245
otherwise
243
246
244
- This option can be used to disable CSRF protection of forms. You need to
245
- disable CSRF protection to be able to disable session. For example, this
246
- is useful when you only use forms in an API-only website.
247
+ This option can be used to disable CSRF protection on *all * forms. But you
248
+ can also :ref: `disable CSRF protection on individual forms <form-disable-csrf >`.
249
+
250
+ If you're using forms, but want to avoid starting your session (e.g. using
251
+ forms in an API-only website), ``csrf_protection `` will need to be set to
252
+ ``false ``.
247
253
248
254
field_name
249
255
..........
You can’t perform that action at this time.
0 commit comments