JSP losing session attribute
843835Nov 20 2001 — edited Nov 20 2001I'm creating a web application in which users can register with the site, login, and change their details.
To change their details, they must be logged in.
When a user logs in, an attribute is added to the session:
String username=request.getParameter("username");
session.setAttribute("username",username);
When the user clicks the Change Details link, the request is passed through a controller to a ChangeDetailsHandler servlet. At this point, the session attribute still exists. A UserInfoBean is also added to the session containing the user's details.
The request is then dispatched to changeDetails.jsp. Again, the username attribute is still in the session, as is the UserInfoBean.
When the user submits the changes to their details, the request goes through the controller to the ChangeDetailsHandler again. However, when it gets here, the session still contains the UserInfoBean, but has lost the username attribute.
I don't call session.removeAttribute() at any time. Any how this attribute could be lost?
Thanks,
Jim