@@ -28,6 +28,7 @@ Configuration
28
28
**Basic Options **:
29
29
30
30
* `access_denied_url `_
31
+ * `delete_cookies `_
31
32
* `erase_credentials `_
32
33
* `hide_user_not_found `_
33
34
* `session_fixation_strategy `_
@@ -51,6 +52,81 @@ access_denied_url
51
52
Defines the URL where the user is redirected after a ``403 `` HTTP error (unless
52
53
you define a custom access denial handler). Example: ``/no-permission ``
53
54
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
+
54
130
erase_credentials
55
131
~~~~~~~~~~~~~~~~~
56
132
0 commit comments