[eluser]Jim Higgins[/eluser]
Yeah, I wanted to use the built in CI functionality as well, but in the end, the regular PHP is almost identical and I couldn't waste anymore time on it. I have yet to see a real explanation for why the CI set_cookie doesn't work all of the time. I've seen lots of people with the issue and lots of suggested reasons, but when it came down to it (for me at least) it seemed to just be some weird CI thing. As soon as I did the exact same thing with the PHP version, it worked fine. One thing to note is I think the parameters are in different order.
Code:
setcookie('my_cookie_name', '', -1, '/');
Another thing... I am able to use the input->cookie to retrieve my cookies that I set with the regular PHP.
Code:
$this->input->cookie('my_cookie_name')
but, the weird thing was I could not get them with this method on in my index (default controller)... only on every other controller in my application. So, in my default controller, I am using
Code:
$my_cookie = $_COOKIE['my_cookie_name'];
Lastly, make sure you still run xss clean on your cookie data if you use the PHP version.