1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
5 * An open source application development framework for PHP 5.1.6 or newer
8 * @author ExpressionEngine Dev Team
9 * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
10 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
16 // ------------------------------------------------------------------------
19 * CodeIgniter Cookie Helpers
21 * @package CodeIgniter
24 * @author ExpressionEngine Dev Team
25 * @link http://codeigniter.com/user_guide/helpers/cookie_helper.html
28 // ------------------------------------------------------------------------
33 * Accepts six parameter, or you can submit an associative
34 * array in the first parameter containing all the values.
38 * @param string the value of the cookie
39 * @param string the number of seconds until expiration
40 * @param string the cookie domain. Usually: .yourdomain.com
41 * @param string the cookie path
42 * @param string the cookie prefix
45 if ( ! function_exists('set_cookie'))
47 function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE)
49 // Set the config file options
50 $CI =& get_instance();
51 $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure);
55 // --------------------------------------------------------------------
58 * Fetch an item from the COOKIE array
65 if ( ! function_exists('get_cookie'))
67 function get_cookie($index = '', $xss_clean = FALSE)
69 $CI =& get_instance();
73 if ( ! isset($_COOKIE[$index]) && config_item('cookie_prefix') != '')
75 $prefix = config_item('cookie_prefix');
78 return $CI->input->cookie($prefix.$index, $xss_clean);
82 // --------------------------------------------------------------------
88 * @param string the cookie domain. Usually: .yourdomain.com
89 * @param string the cookie path
90 * @param string the cookie prefix
93 if ( ! function_exists('delete_cookie'))
95 function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '')
97 set_cookie($name, '', '', $domain, $path, $prefix);
102 /* End of file cookie_helper.php */
103 /* Location: ./system/helpers/cookie_helper.php */