File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -354,20 +354,14 @@ enabled
354354This option can be used to disable CSRF protection on *all * forms. But you
355355can also :ref: `disable CSRF protection on individual forms <form-csrf-customization >`.
356356
357- If you're using forms, but want to avoid starting your session (e.g. using
358- forms in an API-only website), ``csrf_protection `` will need to be set to
359- ``false ``.
360-
361- example:
362-
363357.. configuration-block ::
364358
365359 .. code-block :: yaml
366360
367361 # config/packages/framework.yaml
368362 framework :
369363 # ...
370- csrf_protection : true # can be true or false
364+ csrf_protection : true
371365
372366 .. code-block :: xml
373367
@@ -391,10 +385,14 @@ example:
391385 use Symfony\Config\FrameworkConfig;
392386 return static function (FrameworkConfig $framework) {
393387 $framework->csrfProtection()
394- ->enabled(true) #can be true or false
388+ ->enabled(true)
395389 ;
396390 };
397391
392+ If you're using forms, but want to avoid starting your session (e.g. using
393+ forms in an API-only website), ``csrf_protection `` will need to be set to
394+ ``false ``.
395+
398396.. _config-framework-error_controller :
399397
400398error_controller
You can’t perform that action at this time.
0 commit comments