bug #24691 [HttpFoundation] Fix caching of session-enabled pages (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Fix caching of session-enabled pages

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24690
| License       | MIT
| Doc PR        | -

Commits
-------

572e02cec5 [HttpFoundation] Fix caching of session-enabled pages
This commit is contained in:
Tobias Schultze 2017-10-26 12:26:53 +02:00
commit fdac9e3911
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