summaryrefslogtreecommitdiffstats
path: root/system/helpers/cookie_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/cookie_helper.php')
-rw-r--r--system/helpers/cookie_helper.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php
index e5cf6b1d6..a79083a63 100644
--- a/system/helpers/cookie_helper.php
+++ b/system/helpers/cookie_helper.php
@@ -56,11 +56,10 @@ if ( ! function_exists('set_cookie'))
* @param bool true makes the cookie accessible via http(s) only (no javascript)
* @return void
*/
- function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE)
+ function set_cookie($name, $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE, $httponly = FALSE)
{
// Set the config file options
- $CI =& get_instance();
- $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly);
+ get_instance()->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly);
}
}
@@ -75,11 +74,11 @@ if ( ! function_exists('get_cookie'))
* @param bool
* @return mixed
*/
- function get_cookie($index = '', $xss_clean = FALSE)
+ function get_cookie($index, $xss_clean = NULL)
{
- $CI =& get_instance();
+ is_bool($xss_clean) OR $xss_clean = (config_item('global_xss_filtering') === TRUE);
$prefix = isset($_COOKIE[$index]) ? '' : config_item('cookie_prefix');
- return $CI->input->cookie($prefix.$index, $xss_clean);
+ return get_instance()->input->cookie($prefix.$index, $xss_clean);
}
}
@@ -96,7 +95,7 @@ if ( ! function_exists('delete_cookie'))
* @param string the cookie prefix
* @return void
*/
- function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '')
+ function delete_cookie($name, $domain = '', $path = '/', $prefix = '')
{
set_cookie($name, '', '', $domain, $path, $prefix);
}