Forum Moderators: coopster

Message Too Old, No Replies

Cookie not deleted when using Firefox?!

But fine in IE

         

jazzle

2:06 pm on Sep 29, 2005 (gmt 0)

10+ Year Member



Hi everyone.
I've just started my first foray into using cookies, and am using PHP to do so.

I have a cookie to remember the user's id:
setcookie("userid", $userid, time() + 604800);
which seems to work fine.

I delete the cookie with:
setcookie("userid", "", mktime(12,0,0,1, 1, 1990));
trying to be on the safe side by using the date function.

My problem is that it all works fine in IE, but Fx seems to keep the cookie no matter what I do.

Any ideas?
And am I using the best code?

ergophobe

6:15 pm on Sep 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



IN theory:


Cookies must be deleted with the same parameters as they were set with. If the value argument is an empty string, or FALSE, and all other arguments match a previous call to setcookie, then the cookie with the specified name will be deleted from the remote client.

Try using the same parameters (i.e. make the expire params match) and see what happens.

jazzle

10:04 am on Oct 3, 2005 (gmt 0)

10+ Year Member



still no luck, both using the same precise date, and with no date at all.