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

For some strange odd reason my cookies are deleted from my harddrive, but they say exist when I goto site?
my $cookie = cookie( -NAME => "Matrix", -VALUE => "", -EXPIRES => "", -PATH => "/", ); print header(-COOKIE => $cookie, -COOKIE => $cookie, );
Thast how I deleted them

Replies are listed 'Best First'.
Re: Cookies not deleting
by defyance (Curate) on Nov 02, 2002 at 06:50 UTC
    Sometimes, the answer is right under your nose.

    Love that search bar!

    my $cookie = cookie( -NAME => "Matrix", -VALUE => "", -EXPIRES => "-1d", -PATH => "/", ); print header(-COOKIE => $cookie, -COOKIE => $cookie, );
    UPDATE:Meant to add revised code.
    UPDATE2:Fixed Syntax Error. Nice Catch LTjake!

    -- Can't never could do anything, so give me and inch, I'll make it a mile.

•Re: Cookies not deleting
by merlyn (Sage) on Nov 02, 2002 at 15:11 UTC
    Also remember that "delete this cookie" is merely a request, and can be ignored.

    If the purpose of a cookie has been completed, you'll need to change server-side state to ignore that cookie. Sending the "delete cookie" is merely a convenience, and should not be a mandatory part of your security policy.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.