I'm playing around with using cookies, and I have a question. How does one "get rid of" a cookie before its expiration? I'm using a cookie to store login information, but what if the user decides they no longer want the site to remember their info? Thanks.
Yes that is correct. But remember how cookies work. You have to re-invoke the script to get the server to resend the new empty cookie. You make need to send them to a simple redirect page to get it to reload the script and pick of the empty or non-existance cookie.
It's also a good idea to set the cookie expiration date to some day in the past. That will pretty much guarantee it will be deleted regardless of whether it has a value or not.
Tracy Dryden
tracy@bydisn.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.