aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2014-05-09 07:39:27 +0200
committermarijus <mario@mariovavti.com>2014-05-09 07:39:27 +0200
commit56eb9e75ccad49c8fcbd569b097c2ea85e7d258f (patch)
tree87411ce648195b34f0a02ed49d60b007a6a8470d /index.php
parent6e397240a3f1a1bb52ef5d9bd3929a6770ac8222 (diff)
parent831b18cf283cd52fd1b01d6c6c4648b8351985a7 (diff)
downloadvolse-hubzilla-56eb9e75ccad49c8fcbd569b097c2ea85e7d258f.tar.gz
volse-hubzilla-56eb9e75ccad49c8fcbd569b097c2ea85e7d258f.tar.bz2
volse-hubzilla-56eb9e75ccad49c8fcbd569b097c2ea85e7d258f.zip
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/index.php b/index.php
index 6019cecd3..a07c1a633 100755
--- a/index.php
+++ b/index.php
@@ -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(
- ((isset($arr['lifetime'])) ? $arr['lifetime'] : 60*5),
- ((isset($arr['path'])) ? $arr['path'] : '/'),
- ((isset($arr['domain'])) ? $arr['domain'] : $a->get_hostname()),
- ((isset($_SERVER['HTTPS'])) ? true : false),
- ((isset($arr['httponly'])) ? $arr['httponly'] : true));
session_start();
/**