| From | Sent On | Attachments |
|---|---|---|
| Rachel Greenham | Aug 10, 2000 5:02 am | |
| Yun Sang Jung | Aug 10, 2000 5:20 am | |
| Brian Richards | Aug 10, 2000 5:24 am | |
| Craig R. McClanahan | Aug 10, 2000 10:07 am |
| Subject: | Losing cookie if hostname different, under apache | |
|---|---|---|
| From: | Rachel Greenham (rach...@enetgroup.co.uk) | |
| Date: | Aug 10, 2000 5:02:20 am | |
| List: | org.apache.tomcat.users | |
It's an odd one:
It would appear that, under Apache, if you change the hostname by which you access a web server, even if that hostname resolves to the same actual host, Tomcat can't pick up the cookie.
ie: As I'm on the same subnet, I start with http://myhost/ but as I progress through the site a redirect or something including just me typing a URL directly, causing a switch to using the FQDN eg: http://myhost.mydomain.etc/, the switch causes Tomcat to mislay the cookie or session object.
But this *doesn't* happen when Tomcat is used in standalone mode - ie: if I access the same site on port 8080 rather than port 80, and again switch from http://myhost/ to http://myhost.mydomain.etc/ - the cookie/session object remains accessible regardless of changes in the hostname the client makes.
The problem only occurs when the site is used through Apache, so presumably it's a problem in Apache and/or the JServ connector. I tried uncommenting the ServerName directive in httpd.conf so it explicitly specifies the host's FQDN but it made no difference. Any ideas anyone?
I'm not even sure I should be considering it a bug, as this might be a necessary thing to allow virtual hosting to work in Apache.
FWIW: Apache 1.3.12, Tomcat 3.1 (including mod_jserv.so built from Tomcat 3.1 sources), running on Linux and Sun JDK1.3 beta.
-- Rachel





