Updated code using HttpSession.