Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

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

Okay Nomis52, I've done some testing on a local server, and it works for me, setting both cookies each time.

    Tested version info:
  • Apache 1.3.12
  • mod_perl 1.26
  • CGI 2.81
  • CGI::Application 2.5

I tried multiple cookies using CGI.pm directly, and I tried the same using CGI::Application, all under mod_perl, and under each scenario I get both cookies without issue. I know you didn't want to hear that :)

What happens when you try a very simple script like:

#!/usr/bin/perl use CGI::Application; my $a = new CGI::Application; my $c1 = $a->query->cookie(-name=>'userID', -value=>'test123', ); my $c2 = $a->query->cookie(-name=>'sessionID', -value=>'blahblahblah', ); $a->header_props(-cookie => [$c1,$c2]); $a->run;
C::A ought to give you a list of %ENV, one if which should be HTTP_COOKIE => 'userID=test123; sessionID=blahblahblah' in this case. Do you get that environment value okay, even when the cookies don't come through?

Anyway, I'm thinking maybe a version issue somewhere along the line.

Update: Below is the output from an HTTP session using the above code under mod_perl:

[admin@bart][~]$ telnet localhost 80 Trying 127.0.0.1... Connected to localhost (127.0.0.1). Escape character is '^]'. get /perl/test3.cgi HTTP/1.0 HTTP/1.1 200 OK Date: Sun, 28 Jul 2002 05:08:17 GMT Server: Apache/1.3.12 (Unix) (Red Hat/Linux) PHP/3.0.15 mod_perl/1.26 Set-Cookie: userID=test123; path=/ Set-Cookie: sessionID=blahblahblah; path=/ Connection: close Content-Type: text/html; charset=ISO-8859-1 <P> Query Parameters:<BR> <OL> </OL> <P> Query Environment:<BR> <OL> <LI> DOCUMENT_ROOT => '<B>/home/httpd/html</B>' <LI> GATEWAY_INTERFACE => '<B>CGI-Perl/1.1</B>' <LI> MOD_PERL => '<B>mod_perl/1.26</B>' <LI> PATH => '<B>/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin</B>' <LI> QUERY_STRING => '<B></B>' <LI> REMOTE_ADDR => '<B>127.0.0.1</B>' <LI> REMOTE_PORT => '<B>1357</B>' <LI> REQUEST_METHOD => '<B>get</B>' <LI> REQUEST_URI => '<B>/perl/test3.cgi</B>' <LI> SCRIPT_FILENAME => '<B>/home/httpd/perl/test3.cgi</B>' <LI> SCRIPT_NAME => '<B>/perl/test3.cgi</B>' <LI> SERVER_ADDR => '<B>127.0.0.1</B>' <LI> SERVER_ADMIN => '<B>webmaster@lithocraft.com</B>' <LI> SERVER_NAME => '<B>bart.lithocraft.com</B>' <LI> SERVER_PORT => '<B>80</B>' <LI> SERVER_PROTOCOL => '<B>HTTP/1.0</B>' <LI> SERVER_SIGNATURE => '<B><ADDRESS>Apache/1.3.12 Server at bart.lit +hocraft.com Port 80</ADDRESS> </B>' <LI> SERVER_SOFTWARE => '<B>Apache/1.3.12 (Unix) (Red Hat/Linux) PHP/ +3.0.15 mod_perl/1.26</B>' <LI> UNIQUE_ID => '<B>PUN8Qc9c3QYAAC5MELk</B>' </OL> Connection closed by foreign host.

cheers!


In reply to Re: Re: Multiple Cookies with CGI::Application by sedhed
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 taking refuge in the Monastery: (2)
As of 2024-04-19 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found