diff options
author | root <root@bawker.net> | 2014-05-10 10:55:50 -0700 |
---|---|---|
committer | root <root@bawker.net> | 2014-05-10 10:55:50 -0700 |
commit | 80796c78f5326c670893476fe8e9024c30ebffcc (patch) | |
tree | 9be350288804ab8fa46e2ce10043c91e5c97672f /index.php | |
parent | 711719ce0ce340fbcda7559bf20582e85e4b1e3d (diff) | |
parent | 481b4c21c9ab6e7e6df8f65ef97135fb5807d7fd (diff) | |
download | volse-hubzilla-80796c78f5326c670893476fe8e9024c30ebffcc.tar.gz volse-hubzilla-80796c78f5326c670893476fe8e9024c30ebffcc.tar.bz2 volse-hubzilla-80796c78f5326c670893476fe8e9024c30ebffcc.zip |
Merge branch 'master' of https://github.com/chriswinstead/red
Diffstat (limited to 'index.php')
-rwxr-xr-x | index.php | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -55,6 +55,17 @@ if(! $a->install) { call_hooks('init_1'); load_translation_table($a->language); + // Force the cookie to be secure (https only) if this site is SSL enabled. Must be done before session_start(). + + if(intval($a->config['system']['ssl_cookie_protection'])) { + $arr = session_get_cookie_params(); + session_set_cookie_params( + ((isset($arr['lifetime'])) ? $arr['lifetime'] : 60*5), + ((isset($arr['path'])) ? $arr['path'] : '/'), + ((isset($arr['domain'])) ? $arr['domain'] : $a->get_hostname()), + ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? true : false), + ((isset($arr['httponly'])) ? $arr['httponly'] : true)); + } } else { // load translations but do not check plugins as we have no database @@ -73,15 +84,6 @@ else { * */ -// Force the cookie to be secure (https only) if this site is SSL enabled. Must be done before session_start(). - -$arr = session_get_cookie_params(); -session_set_cookie_params( - $arr['lifetime'], - $arr['path'], - $arr['domain'], - (($_SERVER['HTTPS']) ? true : false), - $arr['httponly']); session_start(); /** |