From 25ab0a285e2195afa08b65294a2e0c5fd80a91a4 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Sun, 7 Jan 2018 01:09:31 +0100
Subject: [PATCH] Cleanup

---
 modules/consent/lib/Consent/Store/Cookie.php | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/modules/consent/lib/Consent/Store/Cookie.php b/modules/consent/lib/Consent/Store/Cookie.php
index 4d5d1f0d3..d9b9d0a13 100644
--- a/modules/consent/lib/Consent/Store/Cookie.php
+++ b/modules/consent/lib/Consent/Store/Cookie.php
@@ -275,18 +275,12 @@ class sspmod_consent_Consent_Store_Cookie extends sspmod_consent_Store
 
         $globalConfig = SimpleSAML_Configuration::getInstance();
         $params = array(
-            'lifetime' => (90*24*60*60),
+            'lifetime' => 7776000,    // (90*24*60*60)
             'path' => ($globalConfig->getBasePath()),
-            'httponly' => false,
+            'httponly' => true,
+            'secure' => \SimpleSAML\Utils\HTTP::isHTTPS(),
         );
 
-        if (\SimpleSAML\Utils\HTTP::isHTTPS()) {
-            // Enable secure cookie for https-requests
-            $params['secure'] = true;
-        } else {
-            $params['secure'] = false;
-        }
-
         \SimpleSAML\Utils\HTTP::setCookie($name, $value, $params, false);
     }
 }
-- 
GitLab