I have a problem that I've cooked down to a simple test scenario:
A servlet (call it servlet_1) gets an HttpSession and sets an
attribute in it:
req.getSession().setAttribute(new String("Boo!"));
It then forwards to another servlet, servlet_2, which in turn
forwards to another servlet, servlet_3.
The attribute set in servlet_1 is nowhere to be found in the
HttpSession that servlet_3 gets from req.getSession(). And,
servlet_3's session has a different ID from the one in the
previous two servlets.
servlet_2, however, was able to access the attribute from the session
it got from req.getSession(), which had the same ID as the original
in servlet_1.
What happens to the HttpSession on that second forward?
This happens:
- under tomcat 3.2.1 apache 1.3.19, Solaris 2.8, Sun Ultra 60
- when the servlet is first accessed after a server restart,
- when the servlet is again accessed after the 30-minute
session timeout.
It doesn't happen (the session attribute is accessible from servlet_3):
- all other times, i.e. the session has been created in a
previous access of the servlet(s), less than 1/2 hour ago.
Does this make sense to anybody? Suggestions welcome. Thanks.
-Allen Hopkins
Gigascale Silicon Research Center
UC Berkeley