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 @@ -1781,6 +1781,8 @@ The CSRF token can be customized on a form-by-form basis. For example::
1781
1781
// ...
1782
1782
}
1783
1783
1784
+ .. _form-disable-csrf :
1785
+
1784
1786
To disable CSRF protection, set the ``csrf_protection `` option to false.
1785
1787
Customizations can also be made globally in your project. For more information,
1786
1788
see the :ref: `form configuration reference <reference-framework-form >`
Original file line number Diff line number Diff line change @@ -218,8 +218,11 @@ enabled
218
218
219
219
Whether or not to enable support for the Form component.
220
220
221
- You will also have to disable form support if you want to
222
- :ref: `disable the validation support <validation-enabled >`.
221
+ If you don't use forms, setting this to ``false `` may increase your application's
222
+ performance because less services will be loaded into the container.
223
+
224
+ If this is activated, the :ref: `validation system <validation-enabled >`
225
+ is also enabled automatically.
223
226
224
227
csrf_protection
225
228
~~~~~~~~~~~~~~~
@@ -232,9 +235,12 @@ enabled
232
235
**type **: ``boolean `` **default **: ``true `` if form support is enabled, ``false ``
233
236
otherwise
234
237
235
- This option can be used to disable CSRF protection of forms. You need to
236
- disable CSRF protection to be able to disable session. For example, this
237
- is useful when you only use forms in an API-only website.
238
+ This option can be used to disable CSRF protection on *all * forms. But you
239
+ can also :ref: `disable CSRF protection on individual forms <form-disable-csrf >`.
240
+
241
+ If you're using forms, but want to avoid starting your session (e.g. using
242
+ forms in an API-only website), ``csrf_protection `` will need to be set to
243
+ ``false ``.
238
244
239
245
field_name
240
246
..........
You can’t perform that action at this time.
0 commit comments