summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-12-12 14:33:30 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-12-12 14:33:30 +0100
commitb19fae262994a847fa6f74fe629140ba11daca80 (patch)
treee94d281ce14b42c698ec4558f813d18c04eac0c1 /lib/base.php
parent14c83e415c2e1e748c335fcb48a5b979240ecb9d (diff)
downloadnextcloud-server-b19fae262994a847fa6f74fe629140ba11daca80.tar.gz
nextcloud-server-b19fae262994a847fa6f74fe629140ba11daca80.zip
Fix error log on PHP 7.2
Fixes following error in the logs: "ini_set(): A session is active. You cannot change the session module's ini settings at this time" Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php
index f6b4f5555eb..d0672785cef 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -412,6 +412,10 @@ class OC {
}
public static function initSession() {
+ if(self::$server->getRequest()->getServerProtocol() === 'https') {
+ ini_set('session.cookie_secure', true);
+ }
+
// prevents javascript from accessing php session cookies
ini_set('session.cookie_httponly', true);
@@ -663,9 +667,6 @@ class OC {
self::checkInstalled();
OC_Response::addSecurityHeaders();
- if(self::$server->getRequest()->getServerProtocol() === 'https') {
- ini_set('session.cookie_secure', true);
- }
self::performSameSiteCookieProtection();