http://www.perlmonks.org?node_id=625561

jck has asked for the wisdom of the Perl Monks concerning the following question:

Oh wise monks!

i'm sorry to trouble you with this one, but i've run out of ideas. i have a login script, based on Merlyn's excellent suggestions, that was working great until a couple of months ago, when all of my users on IE were suddenly unable to log on. i figured it might be a privacy issue, and i set up a privacy policy that now passes the w3 privacy validator.

but, IE still won't set the cookies to let me in.

you can try this at:

http://tikvatisrael.org/memberarea/login/

and use "guest" and "guest" as username and password. it works in firefox, safari, opera, etc, but in IE, it just blinks, and goes back to the login page.

the code that is setting the cookies is:

my $cookie = $query->cookie( -name=>"SESSID", -value=> $sessid, -expires => "+1h", -path=> "/"); print $query-> redirect( -uri=>"http://tikvatisrael.org/memberarea/taskmenu/", -cookie=> $cookie);
i'm using CGI.pm, but not using CGI::Cookies. could that be the simple answer??

Replies are listed 'Best First'.
Re: IE cookies problem
by EvanCarroll (Chaplain) on Jul 09, 2007 at 05:41 UTC
    some suggestions:
    1. Use Data::Dumper and die Dumper $cookie
    2. Use tshark to examine the traffic over port 80, type http, print the request, diff it with the request from Moz. The result is your problem


    Evan Carroll
    www.EvanCarroll.com
      Evan, thanks for the suggestions, but wondering if you could expand a bit...

      1. Use Data::Dumper and die Dumper $cookie

      Where do i put the "die Dumper $cookie" line?
      2. Use tshark to examine the traffic over port 80, type http, print the request, diff it with the request from Moz. The result is your problem
      tshark seems to be part of wireshark? i load this on the server? i have no idea about this....if you could help point me in the right general direction....
      I appreciate the ideas - since this is a very frustrating situation for me and my users (although, i wish they'd all just switch to firefox, at this point!!)
        You would put the die Dumper line, right after you first set $cookie.
        Tshark doesn't have to be loaded on the server, just run it on any machine making the request. The idea is you want to capture the request both browsers are sending, since only one type of browser, Moz, works.


        Evan Carroll
        www.EvanCarroll.com
Re: IE cookies problem
by skx (Parson) on Jul 09, 2007 at 06:12 UTC

    I've seen issues in the past where Internet Explorer doesn't follow refreshes if the size of the response is "too small".

    I might guess that is the problem, but without more details it is hard to know.

    Steve
    --
      what details would help? this site is used by a lot of older folks, many of whom have no idea about browsers, and their kids set up their machines - so i have little hope of getting them to migrate away from IE.....i've gotta fix this access problem on my end!!
Re: IE cookies problem
by ides (Deacon) on Jul 09, 2007 at 16:08 UTC

    I've run into this before myself and as strange as it sounds, it probably isn't your code, but the user's date, time, and specifically their time zone settings.

    I'm not 100% sure about IE7, but with older versions of IE if the expires time was less than 2 hours and the user has their Windows set to the default Pacific time zone and they say live on the East coast IE sees the cookie as already expired and does not set it. Netscape/Mozilla/etc at least set the cookie for the browser session at that point which is why you don't see it with those.

    I know it sounds strange, but get a few of the users to tell you their actual timezone and what they have their computer set to and I bet it solves your problem.

    Hope this helps...

    Frank Wiles <frank@revsys.com>
    www.revsys.com

      i did think about that - but this happens when i try to log on myself using IE6 or IE7 (both of them crash), and with Firefox and other browsers it works just fine - this is from the same machine, so the time is set the same no matter which browser i'm using....

      most of my users are in the same town as i am, so we're all in the same time zone (physically, at least)

        Well if you've tested it then it may not be the case. But in the experience I was talking about all of the users were also in my hometown and you would assume in the same time zone.... but being in the Central Time Zone, LOTS of people never change the Windows default from the Pacific Time Zone which made it 2 hours off for us.

        Frank Wiles <frank@revsys.com>
        www.revsys.com

Re: IE cookies problem
by bibliophile (Prior) on Jul 09, 2007 at 14:02 UTC
    This probably isn't very helpful... but I've heard of something like this before. The user was using IE 5; switching to IE 6 made the problem go away, though no explanation was ever found (of course, once things were working, the Powers That Be stopped looking for an explanation).

    I guess it's called "Internet Exploder" for a reason... :-)

      great! well, this seems the reverse - everything worked well, until recently - i haven't polled my users on who might be able to log on using IE, if any. i've been seeing it on my machine with IE 7, but also with IE 6 on another machine.
Re: IE cookies problem
by jck (Scribe) on Jul 13, 2007 at 16:06 UTC
    i'm really hoping that some is still looking at this node, and has any other suggestions - i'm at my wits end!!

    i've tried:

    • added "-domain=>'.domain.com'" to the cookie settings, since somewhere i saw that made a difference
    • done the refresh as a meta header, rather than using the redirect function, with up to 5 sec before the refresh is sent
    • made sure that the PC i'm on is running the correct time at the time that i set the cookie (works right with Moz, as stated)
    i haven't yet tried Evan Carroll's excellent suggestions, mostly because i don't run on Linux, and i'm not sure how to do this with windows (and i can't run it on Mac, since MS won't support IE on the Mac anymore!!) i will try the Data::Dumper suggestion, although i'm a little dubious about how that'll help.....
Re: IE cookies problem
by Anonymous Monk on Jul 13, 2007 at 16:09 UTC

    I just had a look at my own cookie generating code, which is working fine with IE.

    Curiously, it uses a "cookies" parameter rather than "cookie", and a list rather than a single cookie object.

    Ie:

    print $cgi->redirect ( -url => "login.pl?url=$loginurl", -cookies => [GatekeeperCookie::theCookie()], );

    This may or may not be significant. As you're currently investigating this area, your experimentation and feedback would contribute to my understanding too!

      thank you for the suggestion - just to close the loop on this option - i tried the change to cookies and using an array, and it didn't affect it at all - still worked for Moz, and not for IE....see above for the time fix!! still scratching my head on this one!!
        I had similar problems, while developing my own Web Shop solution. Problem got fixed by significantly increasing the "cookie lifetime", namely from 43200 (12 hours) to 10000000 (about 2777 hours). Seems to be an issue in the MS S..t ?