You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Joy Su <js...@patkai.com> on 2000/10/19 05:28:23 UTC

cross-context load balancing?

A fellow developer and I were testing sticky load balancing/sessions and
looking at the Tomcat 3.1 code, and we are baffled by what seems (to us) to
be a problem with Tomcat sessioning.  We were wondering if anyone could help
enlighten us.  (We are using IIS as our webserver, and mod_jserv.)

Basically, we're mapping /*.abc to the docbase webapps/demo.  If we hit a
page like http://localhost/demo/test.abc, we see JSESSIONID with the
jvmroute set correctly; the path of the cookie is /demo.  If we hit a page
like http://localhost/blah/test.abc (or any url without "demo" in it), we
get the right page but the JSESSIONID doesn't have a jvmroute set and the
path of the cookie is now /.  In other words, it seems like the docbase
directory actually has to appear in the url of the page, otherwise we don't
get the jvmroute.  We couldn't figure out why the code that sets the cookie
path (and the code in SessionInterceptor that decides whether the jvmroute
should be used) is using the docBase and not the context path (perhaps
substituting / for "").

Is there a way to get around this?  It seems like JSPs would have the same
problem, if I wanted to do sessioning across multiple contexts (or if I
specified /*.jsp to be mapped in uriworkermap.properties).  Even if I mapped
each context to a different docBase, the cookie paths would be set
differently and I wouldn't get sticky load balancing across contexts.  What
we'd like is to be able to map something like /*.abc to webapps/demo, have
the cookie path be "/", and have the jvmroute set in the JSESSIONID cookie.

Thank you very much in advance,
Joy