<session-config> <session-timeout> 30 </session-timeout> </session-config>
To set a variable in session, you need not edit Web.xml
session
Web.xml
HttpSession session = request.getSession(); String al="am session variable" session.setAttribute("al", al);
and to access it , you can simply do ${sessionScope.al}
${sessionScope.al}
Read How do you store Java objects in HttpSession?