You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Scott Scecina <sc...@soulcage.net> on 2004/02/20 04:38:39 UTC

[mp2] Problem w/Set-Cookie header and Internet Explorer

Hi all,

Background:

I've developed an application that uses a modified version of
Apache::TicketTool (from the book) which I've ported to work with mp2.  My
development platform is WinXP with Apache 2.0.48, Activeperl 5.8.2 and
Randy's build of mod_perl 1.99_12.  Everything works great.

Today I built (and tested, successfully), Apache 2.0.48 (pre-fork), Perl
5.8.3, and mod_perl 1.99_12 on a RH Linux 7.5 (I think).  I installed my
code on that box, and when I connect with Internet Explorer (6, on XP) I
don't seem to be getting the Set-Cookie headers (I've turned on "prompt" for
cookies, and deleted the entire list of "allowed" sites).  Other headers,
like the Location header, seem to be fine.

So, to test if the Set-Cookie headers were actually being sent, I made a
small test script with LWP that fetches the URL and prints the headers.
I've attached the output at the end of this message).  The LWP script shows
that they *were* being sent, and that they looked properly formatted.

Finally, I installed Mozilla, and surprise, surprise, the cookies worked.

Does anybody have a guess as to why IE will see the cookies from the WinXP
Apache and not the Linux Apache?  I'm not going through a proxy or anything
like that.  I tested the phenomenon from a coworker's machine and had the
same problem.

Would a Perl 5.8.2 -> 5.8.3 make a difference?  Tomorrow I plan on
installing AP5.8.3 on the WinXP and Randy's latest MP1.99 to see if I can
reproduce the problem with that.  But I'm doubtful.

BTW, the "Cookbook" cookie handler from the 2.0 docs exhibits the same
problem.

Thanks in Advance!

- Scott


(Note: I've [removed] some addresses)
LWP Header Output from Apache WinXP:

Connection: close
Date: Thu, 19 Feb 2004 21:49:07 GMT
Location: [removed]
Server: Apache/2.0.48 (Win32) mod_perl/1.99_12 Perl/v5.8.2
Content-Length: 361
Content-Type: text/html; charset=iso-8859-1
Client-Date: Thu, 19 Feb 2004 21:49:07 GMT
Client-Peer: 10.0.0.144:80
Client-Response-Num: 1
Client-Warning: Redirect loop detected (max_redirect = 0)
Set-Cookie: request_uri=http%3A%2F%2F[removed]; domain=.[removed].com;
path=/

LWP Header Output from Apache Linux:

Connection: close
Date: Thu, 19 Feb 2004 21:48:13 GMT
Location: [removed]
Server: Apache/2.0.48 (Unix) mod_perl/1.99_12 Perl/v5.8.3
Content-Length: 358
Content-Type: text/html; charset=iso-8859-1
Client-Date: Thu, 19 Feb 2004 21:48:12 GMT
Client-Peer: 10.0.0.252:80
Client-Response-Num: 1
Client-Warning: Redirect loop detected (max_redirect = 0)
Set-Cookie: request_uri=http%3A%2F%2F[removed]%2FWebEDI;
domain=.[removed].com; path=/

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.572 / Virus Database: 362 - Release Date: 1/27/2004


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] Problem w/Set-Cookie header and Internet Explorer

Posted by Larry Leszczynski <la...@emailplus.org>.
Hi Scott -

> when I connect with Internet Explorer (6, on XP) I don't seem to be
> getting the Set-Cookie headers (I've turned on "prompt" for cookies, and
> deleted the entire list of "allowed" sites).  Other headers, like the
> Location header, seem to be fine.

For certain security settings, IE 6 uses site privacy policy information
to decide whether to accept incoming cookies or not.  I've been bitten by
this before - it just silently discards the cookies and you have no idea
what's going on.  You may need to output an additional P3P header that
describes your site's privacy policies to coerce IE 6 into accepting your
cookie headers.  Google for P3P and you should be able to find enough
info.


HTH,
Larry Leszczynski


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Problem w/Set-Cookie header and Internet Explorer

Posted by Scott Scecina <sc...@soulcage.net>.
Ged Haywood writes: 

> Hi there, 
> 
> On Thu, 19 Feb 2004, Scott Scecina wrote: 
> 
>> Apache 2.0.48 (pre-fork), Perl 5.8.3, and mod_perl 1.99_12 on a RH Linux
>> ... when I connect with Internet Explorer (6, on XP) I don't seem to be
>> getting the Set-Cookie headers ... Other headers ... seem to be fine.
>> ... they *were* being sent, and .... they looked properly formatted.
>> ... installed Mozilla ... the cookies worked. 
>> 
>> Does anybody have a guess as to why IE will see the cookies from the WinXP
>> Apache and not the Linux Apache?

Believe me, the thought crossed my mind.  However... 

It finally occured to me that the hostname of the Linux box had an '_' in 
it, which I believe is not legal.  I setup a test hostname w/o the 
underscore and IE worked fine.  Apparently IE does a sanity check on the 
hostname before even beginning to accept the cookie.  Question is, is this a 
bug or a feature :) 

Thanks for the help.  BTW: ethereal is very cool. 

 - Scott

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] Problem w/Set-Cookie header and Internet Explorer

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,

On Thu, 19 Feb 2004, Scott Scecina wrote:

> Apache 2.0.48 (pre-fork), Perl 5.8.3, and mod_perl 1.99_12 on a RH Linux
> ... when I connect with Internet Explorer (6, on XP) I don't seem to be
> getting the Set-Cookie headers ... Other headers ... seem to be fine.
> ... they *were* being sent, and .... they looked properly formatted.
> ... installed Mozilla ... the cookies worked.
> 
> Does anybody have a guess as to why IE will see the cookies from the WinXP
> Apache and not the Linux Apache?

Not wanting to make any jokes about the provenance, no.

I'd suggest that you use ethereal or (failing that) tcpdump to look at
the traaffic.  Might be that some of the non-printing characters aren't
the same in the two cases.  Have you done things like \n instead of \r\n?

73,
Ged.



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html