Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found