users@glassfish.java.net

Cookies, load balancers, and Internet Explorer

From: Scott Oaks <Scott.Oaks_at_Sun.COM>
Date: Tue, 29 Apr 2008 22:34:07 -0400

I have a HW loadbalancer sitting in front of my glassfish cluster. When
I visit the loadbalancer (http://lb.my.local.domain.com), it forwards
the request to one of the instances (http://inst1.my.local.domain.com),
which sends back the response including a JSESSIONID cookie. Then the
next request goes to the loadbalancer, which presumably will use the
cookie to send the request to the appropriate instance.

Which all works flawlessly with Firefox and Opera. IE, however, decides
not to send the cookie back.

I've tried setting the cookieDomain property in sun-web.xml to
.domain.com and to .my.local.domain.com. The cookie makes it to IE
correctly (i.e., visiting /MyAppContext/set.jsp returns a cookie formed
like this:
Set-Cookie: JSESSIONID=idstring; Comment=Sun One Application Server
Sesson Tracking Cookie; Domain=.my.local.domain.com;
Path=/MyAppContext). Yet still, when I visit /MyAppContext/get.jsp, IE
doesn't send back the cookie. If I visit the an appserver instance
directly, then everything works for IE as well as the other browsers --
but I've snooped the network around the loadbalancer; it's not
re-writing the JSESSIONID cookie (the above cookie is what the network
trace on the browser machine looks like).

What completely stupid thing have I missed to get this to work with IE?

-Scott