diff options
author | tobiasbg <devnull@localhost> | 2011-02-18 21:58:48 +0100 |
---|---|---|
committer | tobiasbg <devnull@localhost> | 2011-02-18 21:58:48 +0100 |
commit | ba6432c6e16350c4235ee49ac0388500b28a150c (patch) | |
tree | d149e04a3ee3ebb1ca4e5b86a3405f5a5b91f508 /system/libraries/Session.php | |
parent | 9aa7dc9c96baedf06afb443553a313297158f850 (diff) |
Consistent handling of 'cookie_secure' setting, also makes the variable changeable through the Session class constructor
Diffstat (limited to 'system/libraries/Session.php')
-rw-r--r-- | system/libraries/Session.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 0b94340d5..182294059 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -37,6 +37,7 @@ class CI_Session { var $cookie_prefix = ''; var $cookie_path = ''; var $cookie_domain = ''; + var $cookie_secure = FALSE; var $sess_time_to_update = 300; var $encryption_key = ''; var $flashdata_key = 'flash'; @@ -61,7 +62,7 @@ class CI_Session { // Set all the session preferences, which can either be set // manually via the $params array above or via the config file - foreach (array('sess_encrypt_cookie', 'sess_use_database', 'sess_table_name', 'sess_expiration', 'sess_expire_on_close', 'sess_match_ip', 'sess_match_useragent', 'sess_cookie_name', 'cookie_path', 'cookie_domain', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') as $key) + foreach (array('sess_encrypt_cookie', 'sess_use_database', 'sess_table_name', 'sess_expiration', 'sess_expire_on_close', 'sess_match_ip', 'sess_match_useragent', 'sess_cookie_name', 'cookie_path', 'cookie_domain', 'cookie_secure', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') as $key) { $this->$key = (isset($params[$key])) ? $params[$key] : $this->CI->config->item($key); } @@ -658,8 +659,6 @@ class CI_Session { } $expire = ($this->sess_expire_on_close === TRUE) ? 0 : $this->sess_expiration + time(); - - $secure_cookie = (config_item('cookie_secure') === TRUE) ? 1 : 0; // Set the cookie setcookie( @@ -668,7 +667,7 @@ class CI_Session { $expire, $this->cookie_path, $this->cookie_domain, - $secure_cookie + $this->cookie_secure ); } |