I been looking into this more since I've had some sleep :) From the CGI pod:

To create multiple cookies, give header() an array reference:
print $query->header(-cookie=>[$cookie1,$cookie2]);

I've done this before to set mutliple cookies and its worked, so I assume that this part is ok.

Delving deeper into the code, it seems the reason why I'm getting a '' from the header() method is because of the following in CGI.pm:

if ($MOD_PERL and not $nph) { my $r = Apache->request; $r->send_cgi_header($header); return ''; }

If I print the header out as it appears just before the if , it contains both cookies as seen below

Status: 200 Ok
Set-Cookie: sessionID=blahblahblah; path=/
Set-Cookie: userID=test123; path=/
Date: Sun, 28 Jul 2002 02:31:59 GMT
Content-Type: text/plain; charset=ISO-8859-1

If I telnet to the server the headers I receive are:

HTTP/1.1 200 OK
Date: Sun, 28 Jul 2002 03:17:15 GMT
Server: Apache-AdvancedExtranetServer/1.3.23 (Mandrake Linux/4mdk) mod_ssl/2.8.7 OpenSSL/0.9.6c PHP/4.1.2
Content-Type: text/plain; charset=ISO-8859-1
Set-Cookie: userID=test123; path=/
X-Cache: MISS from quigon.nomis52.com
Transfer-Encoding: chunked

So my belief is that something must be going astray when send_cgi_header() is called.

This problem is driving me crazy.....

Nomis52

In reply to Re: Multiple Cookies with CGI::Application by Nomis52
in thread Multiple Cookies with CGI::Application by Nomis52

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.