summaryrefslogtreecommitdiff
path: root/inc/mod
diff options
context:
space:
mode:
authorChen-Pang He <jdh8@ms63.hinet.net>2014-06-05 18:07:29 +0800
committerczaks <marcin@6irc.net>2014-06-10 17:42:18 +0200
commit6716a24b6844ab2ec1ee7588f1cf024070c395ed (patch)
tree3879ab4e5992cd1399bbf6e30e877b2bda3d9c40 /inc/mod
parent8d745bec2692340c7de3d30f0d36df33e9d83ace (diff)
Send cookie only via HTTPS if a mod logs in via HTTPS, which is the case on this site
Diffstat (limited to 'inc/mod')
-rw-r--r--inc/mod/auth.php4
-rw-r--r--inc/mod/pages.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/inc/mod/auth.php b/inc/mod/auth.php
index f2003dfe..697d06a1 100644
--- a/inc/mod/auth.php
+++ b/inc/mod/auth.php
@@ -69,13 +69,13 @@ function setCookies() {
$mod['hash'][0] . // password
':' .
$mod['hash'][1], // salt
- time() + $config['cookies']['expire'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, false, $config['cookies']['httponly']);
+ time() + $config['cookies']['expire'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, $_SERVER['HTTPS'], $config['cookies']['httponly']);
}
function destroyCookies() {
global $config;
// Delete the cookies
- setcookie($config['cookies']['mod'], 'deleted', time() - $config['cookies']['expire'], $config['cookies']['jail']?$config['cookies']['path'] : '/', null, false, true);
+ setcookie($config['cookies']['mod'], 'deleted', time() - $config['cookies']['expire'], $config['cookies']['jail']?$config['cookies']['path'] : '/', null, $_SERVER['HTTPS'], true);
}
function modLog($action, $_board=null) {
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index a247e35c..5cb98085 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -150,7 +150,7 @@ function mod_dashboard() {
$latest = false;
}
- setcookie('update', serialize($latest), time() + $config['check_updates_time'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, false, true);
+ setcookie('update', serialize($latest), time() + $config['check_updates_time'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, $_SERVER['HTTPS'], true);
}
if ($latest)