[HttpFoundation] Fix caching of session-enabled pages

This commit is contained in:
Nicolas Grekas 2017-10-25 18:42:56 +02:00
parent ed8c731177
commit 572e02cec5
2 changed files with 5 additions and 3 deletions

View File

@ -60,7 +60,8 @@ class NativeSessionStorage implements SessionStorageInterface
* ("auto_start", is not supported as it tells PHP to start a session before
* PHP starts to execute user-land code. Setting during runtime has no effect).
*
* cache_limiter, "" (use "0" to prevent headers from being sent entirely).
* cache_limiter, "private_no_expire" (use "0" to prevent headers from being sent entirely).
* cache_expire, "0"
* cookie_domain, ""
* cookie_httponly, ""
* cookie_lifetime, "0"
@ -101,6 +102,7 @@ class NativeSessionStorage implements SessionStorageInterface
{
$options += array(
'cache_limiter' => 'private_no_expire',
'cache_expire' => 0,
'use_cookies' => 1,
'lazy_write' => 1,
);
@ -347,7 +349,7 @@ class NativeSessionStorage implements SessionStorageInterface
}
$validOptions = array_flip(array(
'cache_limiter', 'cookie_domain', 'cookie_httponly',
'cache_limiter', 'cache_expire', 'cookie_domain', 'cookie_httponly',
'cookie_lifetime', 'cookie_path', 'cookie_secure',
'entropy_file', 'entropy_length', 'gc_divisor',
'gc_maxlifetime', 'gc_probability', 'hash_bits_per_character',

View File

@ -15,6 +15,6 @@ $_SESSION is not empty
Array
(
[0] => Content-Type: text/plain; charset=utf-8
[1] => Cache-Control: private, max-age=10800
[1] => Cache-Control: private, max-age=0
)
shutdown