From 22224b513bf5dcb3f34798f0a9568049966d7ee8 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 2 Mar 2010 23:06:53 -0600 Subject: modified cookie helper to use input class --- system/helpers/cookie_helper.php | 43 +--------------------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) (limited to 'system/helpers/cookie_helper.php') diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index 40afadb57..4be371efe 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -46,50 +46,9 @@ if ( ! function_exists('set_cookie')) { function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '') { - if (is_array($name)) - { - foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'name') as $item) - { - if (isset($name[$item])) - { - $$item = $name[$item]; - } - } - } - // Set the config file options $CI =& get_instance(); - - if ($prefix == '' AND $CI->config->item('cookie_prefix') != '') - { - $prefix = $CI->config->item('cookie_prefix'); - } - if ($domain == '' AND $CI->config->item('cookie_domain') != '') - { - $domain = $CI->config->item('cookie_domain'); - } - if ($path == '/' AND $CI->config->item('cookie_path') != '/') - { - $path = $CI->config->item('cookie_path'); - } - - if ( ! is_numeric($expire)) - { - $expire = time() - 86500; - } - else - { - if ($expire > 0) - { - $expire = time() + $expire; - } - else - { - $expire = 0; - } - } - - setcookie($prefix.$name, $value, $expire, $path, $domain, 0); + $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix); } } -- cgit v1.2.3-24-g4f1b