summaryrefslogtreecommitdiffstats
path: root/lib/private/user/session.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/user/session.php')
-rw-r--r--lib/private/user/session.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/user/session.php b/lib/private/user/session.php
index 67a4c7a4361..a7567952053 100644
--- a/lib/private/user/session.php
+++ b/lib/private/user/session.php
@@ -265,7 +265,7 @@ class Session implements IUserSession, Emitter {
* @param string $token
*/
public function setMagicInCookie($username, $token) {
- $secureCookie = \OC_Config::getValue("forcessl", false); //TODO: DI for cookies and OC_Config
+ $secureCookie = \OC::$server->getRequest()->getServerProtocol() === 'https';
$expires = time() + \OC_Config::getValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15);
setcookie("oc_username", $username, $expires, \OC::$WEBROOT, '', $secureCookie, true);
setcookie("oc_token", $token, $expires, \OC::$WEBROOT, '', $secureCookie, true);