Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a login script that logs you off when you close your browser. How can I also make it expire when they click my my LOGOFF link? How do you kill the cookie?

Replies are listed 'Best First'.
•Re: logout button
by merlyn (Sage) on Oct 27, 2004 at 02:39 UTC
Re: logout button
by BUU (Prior) on Oct 26, 2004 at 21:07 UTC
    Print a cookie with the same name but with an empty value. (Or even a value that says "logged out" or whate not). You can also try setting this expiration date to be some time in the past.
Re: logout button
by TedPride (Priest) on Oct 26, 2004 at 21:28 UTC
    Writing over the cookie with some non-allowable value is better, since some browsers are not good about resolving cookie expiration dates.

    See HTTP::Cookie.

Re: logout button
by csuhockey3 (Curate) on Oct 26, 2004 at 23:36 UTC