The expiration method does work - there are a few things you can try to track it down (at the time of my reply theres no code to cast my eye over :P ).

First and foremost you need to determine that the cookie is being set by the script. Ok this sounds a little obvious, however I have to use PWS at work (tell me about it) and its very kind to force a standard content header the moment I print something. Bye bye valid headers - bye bye printing that cookie.

I assume you are using plain old CGI for setting the cookie? If you aren't you should be. I have used CGI::Cookie without problem in the past but recently it 'appears' to not be working. Without changing anything else other than using CGI my code functions again.

The code I use is as follows:

my $query = CGI->new(); my $cookie = $query->cookie( -name => 'forms', -value => '', -path => "/" -expiry => "-1d" ); print $query->header(-cookie=>$cookie);


Hopefully that will work for you. Remember to change the cookie name to that of the one you set to log the details in. If not - please post some snippets here :)

Update:

On an additional note - I would recommend that you completely clear you cache. If you use IE (hey! some of us do) then you must go into the temporary internet files folder and clear everything. You must ensure that all of your cookie files are physically deleted. Don't rely on your browser to do it. </code>

In reply to Re: Deleting cookies by simon.proctor
in thread Deleting cookies by cfreak

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.