File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
user_guide_src/source/changelogs Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,38 @@ In previous versions, headers set by the ``Response`` class were added to existi
109109ones - giving no options to change them. That could lead to unexpected behavior when
110110the same headers were set with mutually exclusive directives.
111111
112+ For example, session will automatically set headers with the ``header() `` function:
113+
114+ .. code-block :: none
115+
116+ Expires: Thu, 19 Nov 1981 08:52:00 GMT
117+ Cache-Control: no-store, no-cache, must-revalidate
118+ Pragma: no-cache
119+
120+ So if we set **Expires ** header one more time we will end up with a duplicated header:
121+
122+ .. code-block :: php
123+
124+ $response->removeHeader('Expires'); // has no effect
125+ return $response->setHeader('Expires', 'Sun, 17 Nov 2024 14:17:37 GMT');
126+
127+ Response headers:
128+
129+ .. code-block :: none
130+
131+ Expires: Thu, 19 Nov 1981 08:52:00 GMT
132+ // ...
133+ Expires: Sun, 17 Nov 2024 14:17:37 GMT
134+
135+ Now, we don't know which one will be picked by the browser or which header is the correct one.
136+ With changes in this version our previous header will be override:
137+
138+ .. code-block :: none
139+
140+ Cache-Control: no-store, no-cache, must-revalidate
141+ Pragma: no-cache
142+ Expires: Sun, 17 Nov 2024 14:17:37 GMT
143+
112144 Interface Changes
113145=================
114146
You can’t perform that action at this time.
0 commit comments