This is how you create a set a variable in your session.
HttpSession aServletSession = request.getSession(true);
// timeout for the session. Default is 30 minutes i beleive
aServletSession.setMaxInactiveInterval(timeout); (optional)
// Se the variable
aServletSession.setAttribute("VariableName", strValue);
Then if you wish to get the variable in another page you do the following.
// this one is false because you just want to make sure there is a session. if this returns null the user doesn't havea session.
HttpSession aServletSession = request.getSession(false);
// Get the variable's value
String value = aServletSession.getAttribute("VariableName");
I think that is all you will need. You can put different type of data in these session variables. Objects, int, String..... I used it for Vectors. So it's flexible.
Joey