Wednesday, September 2, 2009

Internet Explorer Does Not Create Session Cookies

Reference: http://genotrance.wordpress.com/2006/11/23/session-cookies-rejected-by-internet-explorer/

Initial encounter (IE and Chrome problem) was a timezone issue.

Timezone issue

A third website suggested that IE was calculating session cookie timeouts incorrectly such that they seemed to expire in the past. As a result, these already expired cookies were rejected immediately. For example, if the server was in Hawaii and the client in Australia and the server requested a session timeout of one hour, the timeout would have already occurred as far as the client in Australia was concerned.

Firefox didn’t have this issue since it converts both the server as well as the client time to UTC and then calculates the timeout. As interesting as this was, this didn’t seem as the problem since both my laptop client as well as my server were in the same timezone.

---

Next encounter (after setting up VirtualHosts) was a hostname issue, where underscores are not accepted by IE.

(In the comments section of the article)

I was just researching a similar issue I had locally on my laptop, running apache and php. Every request was generating a new session file, but only in IE and not in FireFox.

I traced the problem back to the URL used to access the site. As I develop locally I’m using non-existent URL schemes and I enter them in my hosts file manually.
test1.loc
test2.loc
test_3.loc

When using underscores, IE rejects the cookie… Just thought I’d complete your list.

1 comment:

  1. Thanks for this useful hint, I've been running into this problem today, and when I came across this post, I realized my local domain was called like admin_branch ... and this messed up sessions and authentication as well.
    Cheers!

    Alex

    ReplyDelete