donniep — 2011-09-26T19:30:55-04:00 — #1
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.
logic_earth — 2011-09-26T20:15:44-04:00 — #2
Test the value of the cookie not whether it exists or not.
donniep — 2011-09-26T20:59:18-04:00 — #3
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?
logic_earth — 2011-09-26T22:11:51-04:00 — #4
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.
donniep — 2011-09-27T00:35:45-04:00 — #5
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.