summaryrefslogtreecommitdiffstats
path: root/system/helpers/cookie_helper.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2010-03-03 06:06:53 +0100
committerDerek Jones <derek.jones@ellislab.com>2010-03-03 06:06:53 +0100
commit22224b513bf5dcb3f34798f0a9568049966d7ee8 (patch)
tree3065217badc7d0686f1179d1a728a54ac6d759da /system/helpers/cookie_helper.php
parentc4c34ee996bfa583b45484b4bc7bbd7dc036bb29 (diff)
modified cookie helper to use input class
Diffstat (limited to 'system/helpers/cookie_helper.php')
-rw-r--r--system/helpers/cookie_helper.php43
1 files changed, 1 insertions, 42 deletions
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);
}
}