CodeIgniter Forums
Problem deleting cookies - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem deleting cookies (/showthread.php?tid=7141)



Problem deleting cookies - El Forum - 03-26-2008

[eluser]codelearn[/eluser]
Hey guys,

I'm having a problem deleting cookies using the CI cookie helper. I'm getting the following error in my error log when I use

Code:
delete_cookie("outreach-score");

Quote:PHP Fatal error: Call to undefined function delete_cookie() in /home/etc/etc

I am loading the cookie helper, so that doesnt seem like the problem.

Thanks!


Problem deleting cookies - El Forum - 06-27-2012

[eluser]ci_user[/eluser]
Having the same issue... any resolution?


Problem deleting cookies - El Forum - 06-27-2012

[eluser]InsiteFX[/eluser]
Try this and see if it works. When deleting cookies the expire time has to be in the pass.
Code:
$expire=time()-60*60*24*30;
setcookie("outreach-scorer", "", $expire);



Problem deleting cookies - El Forum - 06-27-2012

[eluser]ci_user[/eluser]
So I guess there is no way to delete the csrf_cookie since CI sets it?


Problem deleting cookies - El Forum - 06-27-2012

[eluser]InsiteFX[/eluser]
The code above should delete any cookies unless CI is re-setting it.
Make sure you have the correct cookie name.