diff options
Diffstat (limited to 'system/core/Input.php')
-rw-r--r-- | system/core/Input.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/system/core/Input.php b/system/core/Input.php index 3957aa63d..25fe102b5 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -211,7 +211,7 @@ class CI_Input { * @param bool true makes the cookie secure * @return void */ - function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE) + function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = NULL) { if (is_array($name)) { @@ -246,6 +246,12 @@ class CI_Input { $expire = ($expire > 0) ? time() + $expire : 0; } + // If TRUE/FALSE is not provided, use the config + if ( ! is_bool($secure)) + { + $secure = (bool) (config_item('cookie_secure') === TRUE); + } + setcookie($prefix.$name, $value, $expire, $path, $domain, $secure); } @@ -676,4 +682,4 @@ class CI_Input { // END Input class /* End of file Input.php */ -/* Location: ./system/core/Input.php */
\ No newline at end of file +/* Location: ./system/core/Input.php */ |