in reply to delete cookie

bigup401 why would you expect "delete" as in https://metacpan.org/pod/CGI#Deleting-a-parameter-completely to touch cookies?

Here is followup to cgi101

sub NoCookiesNoMore { my( $q, $url ) = @_; my @names = $q->cookie; my @coo = map { $q->cookie( -name => $_, -value => [], -expires => '-10y', + ) } @names; $url and return $q->redirect( -location => $url, -cookie => [@coo] + ); return $q->redirect( -cookie => [@coo] ); } ## end sub NoCookiesNoMore __END__ $ perl GoToWellwithCookiesNoMore.cgi Status: 302 Found Set-Cookie: 1=; path=/; expires=Sat, 14-May-2005 02:28:08 GMT Set-Cookie: ro=; path=/; expires=Sat, 14-May-2005 02:28:08 GMT Set-Cookie: 3=; path=/; expires=Sat, 14-May-2005 02:28:08 GMT Set-Cookie: 5=; path=/; expires=Sat, 14-May-2005 02:28:08 GMT Date: Tue, 12 May 2015 02:28:08 GMT Location: http://localhost

Replies are listed 'Best First'.
Re^2: delete cookie (cgi101)
by bigup401 (Pilgrim) on May 12, 2015 at 09:47 UTC

    i got some idea and it worked for me. by overwriting the old cookie and then the browser will delete it because it has expired

    $page = '#page'; $cookie = $cgi->cookie(-name => 'user', -value => '', -expires=> '-1d' +); print $cgi->redirect(-location => $page, -cookie => $cookie);

    it works well now. can delete the old cookie by overwriting it

      Of course it worked, thats how HTTP works