Cookie removal with PHP problem

I have built a custom CMS for a client and now they want a remember me checkbox under the log in form. On my local machine this works perfectly but on the live server which is a Rackspace cloud site I cannot seem to get rid of the cookies.

right now I am using setcookie(‘cookieName’,‘’,1);

I have also tried setcookie(‘cookieName’,‘’,time()-3600);

like I said this is working perfectly on my local machine so any ideas as to why this would not work on the live server or suggestions on things to try would be very appreciated.


Test the value of the cookie not whether it exists or not.

The cookies are not being changed at all. Any idea why on my local machine they would be gone but on the live machine not changed at all?

Do you change the page…ie., redirect them to another page? Or cause the browser to reissue an HTTP request? A cookie won’t change until a browser either reissues an HTTP request or you redirect them to a new page.

Thanks Logic but I ended up figuring out the problem with some help of an admin over at rackspace. This might help someone else who is using their cloud sites platform. It has something to do with the way they do their load balancing so instead of trying to get rid of the cookie you should just set it to ‘0’ and then test for this. Like your first response, so to solve the problem on logout I set the three cookies to a value of ‘0’ making the worthless and easy to test against.