June 13th, 2000, 07:49 AM
I'm writing a Perl CGI script that allows users to login using a web form then stores their password in a temporary cookie. No problems with that.
I'm also aware that this cookie will be deleted when the user closes their browser, as it's been set without an expiration date.
However, I'd like to find a way of deleting the cookie from within a script, allowing an explicit "log out" function on the site, rather than depending on the user shutting down their browser to delete the cookie.
Web mail providers seem to do something like this, though whether they're using the same technology I don't know.
June 13th, 2000, 12:28 PM
I'm not really sure about this, but I've heard that if you send a cookie with the same name, but an expired expiration date, it will overwrite the old cookie, and then the browser will delete it because it has expired.
June 13th, 2000, 01:07 PM
Just so you know, I went ahead and tested it and it worked fine for me.
June 13th, 2000, 02:26 PM
Many thanks for your help. I tried it and it works fine.
Like most things, the answer is almost obvious once you know it! :-))