I am having a weird issue with cookies in CodeIgniter. The problem is I am able to use set_cookie()
inside my custom helper, however I am unable to get data from a cookie? I get the following error:
Call to undefined function cookie()
EDIT
Okay I figured out how to fix this problem.
I needed to do the following:
$CI =& get_instance();
$CI->input->cookie('cookie name')
However, I still don't understand why you can set a cookie with using $CI, but you have to use $CI to retrieve it...?