File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Filter options
components/http_foundation Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Original file line number Diff line number Diff line change @@ -102,6 +102,36 @@ method.
102
102
103
103
For the sake of clarity, some key options are explained in this documentation.
104
104
105
+ Session Cache Limiting
106
+ ~~~~~~~~~~~~~~~~~~~~~~
107
+
108
+ To avoid users seeing stale data, it's common for session-enabled resources to be
109
+ sent with headers that disable caching. For this purpose PHP Sessions has the
110
+ ``sessions.cache_limiter `` option, which determines which headers, if any, will be
111
+ sent with the response when the session in started.
112
+
113
+ Upon construction,
114
+ :class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ NativeSessionStorage `
115
+ sets this global option to ``"" `` (send no headers) in case the developer wishes to
116
+ use a :class: `Symfony\\ Component\\ HttpFoundation\\ Response ` object to manage
117
+ response headers.
118
+
119
+ .. caution ::
120
+
121
+ If you rely on PHP Sessions to manage HTTP caching, you *must * manually set the
122
+ ``cache_limiter `` option in
123
+ :class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Storage\\ NativeSessionStorage `
124
+ to a non-empty value.
125
+
126
+ For example, you may set it to PHP's default value during construction:
127
+
128
+ Example usage::
129
+
130
+ use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
131
+
132
+ $options['cache_limiter'] = session_cache_limiter();
133
+ $storage = new NativeSessionStorage($options);
134
+
105
135
Session Cookie Lifetime
106
136
~~~~~~~~~~~~~~~~~~~~~~~
107
137
You can’t perform that action at this time.
0 commit comments