Add the following files under the ROOT webapp of the default Tomcat 4.1.30 installation. Of course, I understand that storing data in servlet context like this is not a good idea, but for testing purposes it will do what is needed.
When you change from one domain to another, or even one sub-domain to the main domain, you are given a new session. Sessions do not cross domain boundaries even if they share the same Tomcat context.
If you start out on www.somesite.com and then drop the www so that you are now browsing around somesite.com, you have two different sessions.
This can be your friend and your enemy. I am sure that it is a security measure and quite possibly a standard implementation item... but it can be annoying if your site has multiple domain names for the same context. There may be a way to make that less restrictive. I have never looked into it.
Hope this helps.
- Chris Stehno, SCPJ
It's a pleasure to see superheros taking such an interest in science. And this tiny ad: