Deleting Cookies Help?

In one file the cookies are set, like this:

[php]
setcookie(widget, ‘1’, time()+631138520);
setcookie(popup, ‘1’, time()+631138520);[/php]

In another file, I try to delete them like this:

[php]
if($_COOKIE[‘widget’]) {
setcookie(widget, ‘1’, time()-3600);
}
if($_COOKIE[‘popup’]) {
setcookie(popup, ‘1’, time()-3600);
echo ‘

Old preferences have been deleted. Set your new ones below.

’;
}
[/php]

However, it always gives me the “Cannot modify header information” error. Any ideas about what I need to change for it to work?

Make sure they are being edited/deleted before any data is sent to the browser (before any echo’s)

Just what I needed, thank you! :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service