i have the following code, which will logout the user.if the user chooses to not close the browser it should terminate the session by deleting the cookies. But it is not able to delete the cookies..can anybody tell the mistakes i have made..

if ($section eq "logout") { check_user(); #print "Content-type: text/html\n\n"; $cookie1 = $q->cookie(-name=>'id', -value=>'', -expires=>'-1d' -path =>'/', -domain =>'', ); #added by kamesh..it needs to be fixed $cookie2 = $q->cookie(-name=>'pass', -value=>'', -expires=>'-1d' -path =>'/', -domain =>'', ); $cookie3 = $q->cookie(-name=>'user_group_id', -value=>'', -expires=>'-1d' -path =>'/', -domain =>'', ); print $q->header(-cookie =>[$cookie1,$cookie2,$cookie3]); print "<script language=javascript>"; print "window.close()"; print "</script>"; #my $response = $q->cookie("id"); my $response = qq|<b>$LANG{'loggedout'}. <a href=$template{'mainfile' +}?do=main>$LANG{'logbackin'} </a></b>|; $template{'response'} = $response; parse("$global{'data'}/include/tpl/general"); exit; }

thanks
kamesh

In reply to unable to delete cookies by kamesh3183

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.