How would i be able to remove a cookie for which i havent set an expiry time?

I have only seen examples where the expiry time has been set before hand, but a negative number used;

For example, if it was set at +3000, then to remove it, the cookie is set again, but with an expriry time of -3000

For my cookies i am not giving an expiry time ("stay logged in") so how would i remove them if the user clicks log out?

Thanks!!!

    Generally, setting the cookie with a null value would have the effect you desire, I think.

    Also, cookie values are available via the $_COOKIE superglobal, so unset() might even work.

      Write a Reply...