File tree Expand file tree Collapse file tree 1 file changed +71
-0
lines changed Expand file tree Collapse file tree 1 file changed +71
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,77 @@ access_denied_url
4848Defines the URL where the user is redirected after a ``403 `` HTTP error (unless
4949you define a custom access denial handler). Example: ``/no-permission ``
5050
51+ delete_cookies
52+ ~~~~~~~~~~~~~~
53+
54+ **type **: ``array `` **default **: ``[] ``
55+
56+ Lists the names (and other optional features) of the cookies to delete when the
57+ user logs out::
58+
59+ .. configuration-block ::
60+
61+ .. code-block :: yaml
62+
63+ # config/packages/security.yaml
64+ security :
65+ # ...
66+
67+ firewalls :
68+ main :
69+ # ...
70+ logout :
71+ delete_cookies :
72+ cookie1-name : null
73+ cookie2-name :
74+ path : ' /'
75+ cookie3-name :
76+ path : null
77+ domain : example.com
78+
79+ .. code-block :: xml
80+
81+ <!-- config/packages/security.xml -->
82+ <?xml version =" 1.0" encoding =" UTF-8" ?>
83+ <srv : container xmlns =" http://symfony.com/schema/dic/security"
84+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
85+ xmlns : srv =" http://symfony.com/schema/dic/services"
86+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
87+ https://symfony.com/schema/dic/services/services-1.0.xsd" >
88+
89+ <config >
90+ <!-- ... -->
91+
92+ <firewall name =" main" >
93+ <!-- ... -->
94+ <logout path =" ..." >
95+ <delete-cookie name =" cookie1-name" />
96+ <delete-cookie name =" cookie2-name" path =" /" />
97+ <delete-cookie name =" cookie3-name" domain =" example.com" />
98+ </logout >
99+ </firewall >
100+ </config >
101+ </srv : container >
102+
103+ .. code-block :: php
104+
105+ // config/packages/security.php
106+
107+ // ...
108+
109+ return static function (SecurityConfig $securityConfig): void {
110+ // ...
111+
112+ $securityConfig->firewall('main')
113+ ->logout()
114+ ->deleteCookie('cookie1-name')
115+ ->deleteCookie('cookie2-name')
116+ ->path('/')
117+ ->deleteCookie('cookie3-name')
118+ ->path(null)
119+ ->domain('example.com');
120+ };
121+
51122 erase_credentials
52123~~~~~~~~~~~~~~~~~
53124
You can’t perform that action at this time.
0 commit comments