Skip to content

Commit 506a096

Browse files
committed
Warn about NativeSessionStorage altering cache_limiter
1 parent 153565e commit 506a096

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/http_foundation/session_configuration.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@ method.
102102

103103
For the sake of clarity, some key options are explained in this documentation.
104104

105+
.. note::
106+
107+
If you rely on Session settings set outside
108+
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage`, be aware the
109+
constructor sets ``session.cache_limiter`` to ``""``. If you rely on native sessions to manage cache
110+
headers, you *must* at least pass this option to the constructor.
111+
112+
Example usage::
113+
114+
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
115+
116+
$options['cache_limiter'] = session_cache_limiter();
117+
$storage = new NativeSessionStorage($options);
118+
105119
Session Cookie Lifetime
106120
~~~~~~~~~~~~~~~~~~~~~~~
107121

0 commit comments

Comments
 (0)