The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: Cookies, load balancers, and Internet Explorer

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Last Post: Apr 30, 2008 10:56 AM by: Scott Oaks
Scott Oaks
Cookies, load balancers, and Internet Explorer
Posted: Apr 29, 2008 7:34 PM
  Click to reply to this thread Reply

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



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


Scott Oaks
Re: Cookies, load balancers, and Internet Explorer
Posted: Apr 30, 2008 10:56 AM   in response to: Scott Oaks
  Click to reply to this thread Reply

Just in case anyone googles "cookies not returned by internet explorer"
and wonders what's up with this, it turns out that IE will reject
cookies from any host that contains an underscore in it. Apparently even
by design...

So really, nothing at all to do with glassfish (which is doubtless why I
was sent to troubleshoot it...)

-Scott

Scott Oaks wrote:
> 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
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net





 XML java.net RSS