Hello Monks,

I am having a problem getting these set/get cookie scripts to work with Firefox or any Mozilla browsers. I'm befuddled and would appreciate any suggestions.

setacookie.cgi
#!/usr/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser); $query2 = new CGI; $cookie = $query2->cookie(-name=>'TEST-COOKIE', -value=>'test cookie ', -expires=>'24h', -path=>''); print $query2->header(-cookie=>$cookie); print"<html> <body> <a href='http://www.yourdomain.com/cgi-bin/getacookie.cgi'>This is a l +ink</a> </body> </html>"; print $query2->end_html;
getacookie.cgi
#!/usr/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser); $cgi_query = new CGI; print $cgi_query->header; print $cgi_query->start_html('getacookie program'); print $cgi_query->h4('Your cookie name is...'); $testCookie = $cgi_query->cookie('TEST-COOKIE'); print "<PRE>\n"; print $testCookie; print $cgi_query->end_html;

In reply to Problems getting cookies by Anonymous Monk

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.