Hello,
All powerful monks I seek some wisdom, I started to built a apache module to check if a cookie exist, if not it would check authentication against a custom database. if granted I would like to set/drop a encrypted cookie on the client. Then as the client moves through out the site I can check for the cookie and to make sure its valid.
So I'm at the point where I create a cookie and I have checked it and it is created, it seems I can never get it to drop on the clients browser. I have tried a number of ways but none work.
Here is some code
sub new_cookie {
my($product, $plaintext,$cipher) = @_;
my $ciphertext = $cipher->encrypt_hex($plaintext);
return new CGI::Cookie(
-name=>$product,
-value=>$ciphertext,
-path=>'/',
-expires=>''
);
}

$new_cookie_product = new_cookie($product,$plaintext,$cipher);
I have tried a number of things to drop the cookie on the client, but none of the examples I have worked.

In reply to CGI:Cookie, Apache2, Mod_perl2 by overworked

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.