Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

gav (2710)

gav
  (email not shown publicly)
http://www.estey.com/
AOL IM: flufflegavin (Add Buddy, Send Message)

Hacker in NYC.

Journal of gav (2710)

Friday March 19, 2004
09:46 AM

Cookies and Internet Explorer

[ #17968 ]

I've been trying to track down irreproducible cookie problems with Internet Explorer. It seems that sometimes visitors get my "you must enable cookies" page when they are convinced they have cookies enabled.

After some detective work, I've found that IE sends something like:

s=5e264e693f0183c18714eb685191e07a;s=7f354325d7e85ae4c2d349387f884e4b

The first "s" is a invalid session id and the second is the one I want. Digging through CGI::Simple::Cookie I found (the same code is in CGI::Cookie):

# A bug in Netscape can cause several cookies with same name to
# appear.  The FIRST one in HTTP_COOKIE is the most recent version.
$results{$key} ||= $self->new(-name=>$key,-value=>\@values);

I think the only option is to hack it to save an array of cookies and change my session handling code to try each session id. This is a total PITA.

Update:

From Netscape's Cookie Spec:

When sending cookies to a server, all cookies with a more specific path mapping should be sent before cookies with less specific path mappings.

Eureka! An older version of the system was not sending a domain (and thus defaulting to "www.example.com") and now we're using a domain of ".example.com". I guess it's my fault not IE's, I better get back to hacking CGI::Simple...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.