diff --git a/user_guide_src/source/changelogs/v4.6.0.rst b/user_guide_src/source/changelogs/v4.6.0.rst index ddc1e811b51a..de80820e9ee4 100644 --- a/user_guide_src/source/changelogs/v4.6.0.rst +++ b/user_guide_src/source/changelogs/v4.6.0.rst @@ -109,6 +109,38 @@ In previous versions, headers set by the ``Response`` class were added to existi ones - giving no options to change them. That could lead to unexpected behavior when the same headers were set with mutually exclusive directives. +For example, session will automatically set headers with the ``header()`` function: + +.. code-block:: none + + Expires: Thu, 19 Nov 1981 08:52:00 GMT + Cache-Control: no-store, no-cache, must-revalidate + Pragma: no-cache + +So if we set **Expires** header one more time we will end up with a duplicated header: + +.. code-block:: php + + $response->removeHeader('Expires'); // has no effect + return $response->setHeader('Expires', 'Sun, 17 Nov 2024 14:17:37 GMT'); + +Response headers: + +.. code-block:: none + + Expires: Thu, 19 Nov 1981 08:52:00 GMT + // ... + Expires: Sun, 17 Nov 2024 14:17:37 GMT + +Now, we don't know which one will be picked by the browser or which header is the correct one. +With changes in this version our previous header will be override: + +.. code-block:: none + + Cache-Control: no-store, no-cache, must-revalidate + Pragma: no-cache + Expires: Sun, 17 Nov 2024 14:17:37 GMT + Interface Changes =================