timberlineridge wrote in php

Deleting cookies in PHP

Hi all,

I'm having a bit of trouble deleting a cookie once it's been set. The cookie is set using setcookie ("name", "value", time()+3600, "/") ; as you might expect, but when I try and delete it using setcookie ("name", "", time()-3600, "/") ; nothing happens. I've tried setcookie ("name", "value", time()-3600, "/") ; as well just to make all the arguments match, but no joy.

I don't think that there is a problem with the rest of my code as I can substitute the setcookie commands for header ("Location: http://wherever.com") ; ones and they work fine. Is there some peculiarity of deleting cookies I'm missing? I'm running PHP 4.3.2 on Windows 2000/IIS 5.0 and don't have access to the server (so for example can't change to Unix/Apache).