Skip to content

Commit bdb8616

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Security] Document the delete_cookies option
2 parents 0564e14 + 7b9659d commit bdb8616

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

reference/configuration/security.rst

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

3030
* `access_denied_url`_
31+
* `delete_cookies`_
3132
* `erase_credentials`_
3233
* `hide_user_not_found`_
3334
* `session_fixation_strategy`_
@@ -51,6 +52,81 @@ access_denied_url
5152
Defines the URL where the user is redirected after a ``403`` HTTP error (unless
5253
you define a custom access denial handler). Example: ``/no-permission``
5354

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+
54130
erase_credentials
55131
~~~~~~~~~~~~~~~~~
56132

0 commit comments

Comments
 (0)