Skip to content

Commit eff62e1

Browse files
committed
[Security] Reorder the location of the delete_cookies option
1 parent 66cee25 commit eff62e1

File tree

1 file changed

+75
-76
lines changed

1 file changed

+75
-76
lines changed

reference/configuration/security.rst

Lines changed: 75 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Configuration
2828
**Basic Options**:
2929

3030
* `access_denied_url`_
31-
* `delete_cookies`_
3231
* `erase_credentials`_
3332
* `hide_user_not_found`_
3433
* `session_fixation_strategy`_
@@ -52,81 +51,6 @@ access_denied_url
5251
Defines the URL where the user is redirected after a ``403`` HTTP error (unless
5352
you define a custom access denial handler). Example: ``/no-permission``
5453

55-
delete_cookies
56-
~~~~~~~~~~~~~~
57-
58-
**type**: ``array`` **default**: ``[]``
59-
60-
Lists the names (and other optional features) of the cookies to delete when the
61-
user logs out::
62-
63-
.. configuration-block::
64-
65-
.. code-block:: yaml
66-
67-
# config/packages/security.yaml
68-
security:
69-
# ...
70-
71-
firewalls:
72-
main:
73-
# ...
74-
logout:
75-
delete_cookies:
76-
cookie1-name: null
77-
cookie2-name:
78-
path: '/'
79-
cookie3-name:
80-
path: null
81-
domain: example.com
82-
83-
.. code-block:: xml
84-
85-
<!-- config/packages/security.xml -->
86-
<?xml version="1.0" encoding="UTF-8" ?>
87-
<srv:container xmlns="http://symfony.com/schema/dic/security"
88-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
89-
xmlns:srv="http://symfony.com/schema/dic/services"
90-
xsi:schemaLocation="http://symfony.com/schema/dic/services
91-
https://symfony.com/schema/dic/services/services-1.0.xsd">
92-
93-
<config>
94-
<!-- ... -->
95-
96-
<firewall name="main">
97-
<!-- ... -->
98-
<logout path="...">
99-
<delete-cookie name="cookie1-name"/>
100-
<delete-cookie name="cookie2-name" path="/"/>
101-
<delete-cookie name="cookie3-name" domain="example.com"/>
102-
</logout>
103-
</firewall>
104-
</config>
105-
</srv:container>
106-
107-
.. code-block:: php
108-
109-
// config/packages/security.php
110-
$container->loadFromExtension('security', [
111-
// ...
112-
'firewalls' => [
113-
'main' => [
114-
'logout' => [
115-
'delete_cookies' => [
116-
'cookie1-name' => null,
117-
'cookie2-name' => [
118-
'path' => '/',
119-
],
120-
'cookie3-name' => [
121-
'path' => null,
122-
'domain' => 'example.com',
123-
],
124-
],
125-
],
126-
],
127-
],
128-
]);
129-
13054
erase_credentials
13155
~~~~~~~~~~~~~~~~~
13256

@@ -418,6 +342,81 @@ redirected to the ``default_target_path`` to avoid a redirection loop.
418342

419343
**Options Related to Logout Configuration**
420344

345+
delete_cookies
346+
~~~~~~~~~~~~~~
347+
348+
**type**: ``array`` **default**: ``[]``
349+
350+
Lists the names (and other optional features) of the cookies to delete when the
351+
user logs out::
352+
353+
.. configuration-block::
354+
355+
.. code-block:: yaml
356+
357+
# config/packages/security.yaml
358+
security:
359+
# ...
360+
361+
firewalls:
362+
main:
363+
# ...
364+
logout:
365+
delete_cookies:
366+
cookie1-name: null
367+
cookie2-name:
368+
path: '/'
369+
cookie3-name:
370+
path: null
371+
domain: example.com
372+
373+
.. code-block:: xml
374+
375+
<!-- config/packages/security.xml -->
376+
<?xml version="1.0" encoding="UTF-8" ?>
377+
<srv:container xmlns="http://symfony.com/schema/dic/security"
378+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
379+
xmlns:srv="http://symfony.com/schema/dic/services"
380+
xsi:schemaLocation="http://symfony.com/schema/dic/services
381+
https://symfony.com/schema/dic/services/services-1.0.xsd">
382+
383+
<config>
384+
<!-- ... -->
385+
386+
<firewall name="main">
387+
<!-- ... -->
388+
<logout path="...">
389+
<delete-cookie name="cookie1-name"/>
390+
<delete-cookie name="cookie2-name" path="/"/>
391+
<delete-cookie name="cookie3-name" domain="example.com"/>
392+
</logout>
393+
</firewall>
394+
</config>
395+
</srv:container>
396+
397+
.. code-block:: php
398+
399+
// config/packages/security.php
400+
$container->loadFromExtension('security', [
401+
// ...
402+
'firewalls' => [
403+
'main' => [
404+
'logout' => [
405+
'delete_cookies' => [
406+
'cookie1-name' => null,
407+
'cookie2-name' => [
408+
'path' => '/',
409+
],
410+
'cookie3-name' => [
411+
'path' => null,
412+
'domain' => 'example.com',
413+
],
414+
],
415+
],
416+
],
417+
],
418+
]);
419+
421420
invalidate_session
422421
~~~~~~~~~~~~~~~~~~
423422

0 commit comments

Comments
 (0)