mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Session now prevents cache headers being sent unintentionally
This commit is contained in:
parent
779865e29f
commit
b686b86c34
@ -128,6 +128,15 @@ class Session
|
||||
*/
|
||||
private static $cookie_secure = false;
|
||||
|
||||
/**
|
||||
* Name of session cache limiter to use.
|
||||
* Defaults to '' to disable cache limiter entirely.
|
||||
*
|
||||
* @see https://secure.php.net/manual/en/function.session-cache-limiter.php
|
||||
* @var string|null
|
||||
*/
|
||||
private static $sessionCacheLimiter = '';
|
||||
|
||||
/**
|
||||
* Session data.
|
||||
* Will be null if session has not been started
|
||||
@ -275,6 +284,11 @@ class Session
|
||||
session_name('SECSESSID');
|
||||
}
|
||||
|
||||
$limiter = $this->config()->get('sessionCacheLimiter');
|
||||
if (isset($limiter)) {
|
||||
session_cache_limiter($limiter);
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
$this->data = isset($_SESSION) ? $_SESSION : array();
|
||||
|
Loading…
Reference in New Issue
Block a user