Merge pull request #7466 from nextcloud/fix-php7.2-session-init

Fix error log on PHP 7.2
This commit is contained in:
Morris Jobke 2017-12-12 15:45:25 +01:00 committed by GitHub
commit 2943b54f98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -412,6 +412,10 @@ class OC {
} }
public static function initSession() { public static function initSession() {
if(self::$server->getRequest()->getServerProtocol() === 'https') {
ini_set('session.cookie_secure', true);
}
// prevents javascript from accessing php session cookies // prevents javascript from accessing php session cookies
ini_set('session.cookie_httponly', true); ini_set('session.cookie_httponly', true);
@ -663,9 +667,6 @@ class OC {
self::checkInstalled(); self::checkInstalled();
OC_Response::addSecurityHeaders(); OC_Response::addSecurityHeaders();
if(self::$server->getRequest()->getServerProtocol() === 'https') {
ini_set('session.cookie_secure', true);
}
self::performSameSiteCookieProtection(); self::performSameSiteCookieProtection();