-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian,

On 3/20/2009 10:21 AM, Alston, Brian (US SSA) wrote:
> When I go to http://192.168.1.100/examples (no trailing slash), I
> actually get forwarded to a Tomcat server and end up at
> http://192.168.1.110:8080/examples . If this happens, the "Session
> ID" stays the same and all my name/value pairs accumulate in the
> "session" example. However, If I keep adding a trailing slash[, then]
> the URL in the address bar stays that of the load-balancer, BUT,
every time I add a new name/value pair to the "session" example I get a
new "Session ID" and my name/value pairs keep getting overwritten.

This is very good information. Nice investigation, especially because it
leads directly to a conclusion:

Your JSESSIONID cookies have the "wrong" information in them.

Get yourself an HTTP sniffer to verify that this is what is happening:

1. You make a connection to http://192.168.1.100/examples/
2. The request is re-routed to http://192.168.1.110:8080/examples/
3. The server responds with a Set-Cookie header including
   host=192.168.1.110
4. Your next request goes to http://192.168.1.100/examples/, so
   the browser never sends the JSESSIONID cookie back to the server

You need to make sure that the URL the client sees matches the hostname
used in the Set-Cookie header.

When you leave-off the trailing /, the server sends a REDIRECT back to
the client and says "go to http://192.168.1.110:8080/examples/";, and
then everything works fine (because the hostname changes as far as the
client is concerned).

How do you have Apache talking to Tomcat? Are you using mod_proxy_http?
mod_proxy_ajp? mod_jk?

> So what does everybody think? Is this a simple issue or more complex?
> Is this simply a "URL Rewrite" issue or something else?

It's more likely that you are using mod_proxy_http, and you haven't
properly configured a ProxyPassReverse for your servers.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknD/e4ACgkQ9CaO5/Lv0PDXMwCgiq0k00vwDRPtGuACUbHuOfEE
lvMAnAyE59SYdniJ77KU0sUILaSgKthn
=jiRr
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to