I'm trying to set a cookie for a website I'm creating and I'm having a heck of a time. It was working fine and somewhere in my changing things, I've broken the cookie code and can't figure out how. Here's the relevant code:
my $ucookie = new CGI::Cookie(-name=>'userpass', -value=>$userpass, -path=>'/', -domain=>'.comicsconnector.com' -expires=>$expiry, ); my $new_url = "http://www.comicsconnector.com".$curr_page; print header(-cookie=>$ucookie, -location=>$new_url);
When I run the script that sets the cookie, it just doesn't get set. No errors, nothing. It worked fine before and I've checked my browser settings. To debug I printed the normal header and had the cookie header print out on the screen and it looked okay. I've also tried just setting a basic cookie with only the name and value as plain text and still nothing. Is there any way to see errors being generated that would cause the cookie not to be set? I'm pretty much stumped at this point. Thanks.

In reply to Cookie not being set by Indomitus

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.