in reply to Multiple Cookies with CGI::Application
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Multiple Cookies with CGI::Application
by sedhed (Scribe) on Jul 28, 2002 at 05:00 UTC | |
by Nomis52 (Friar) on Jul 28, 2002 at 05:27 UTC | |
by PodMaster (Abbot) on Jul 28, 2002 at 07:14 UTC | |
by yogivan (Acolyte) on Jul 29, 2002 at 10:07 UTC | |
by Nomis52 (Friar) on Jul 28, 2002 at 07:25 UTC |