Attached is the JSP code i have.
I am not sure but it looks like the problems could be in Tomcat configuration, because it seems to display the same page even if I restart the server. For example if I login as user USER-A and refresh following page, it would display USER-A, now if i restart the server and login as USER-B and then call following page, it would still display USER-A until I refresh the page.
I have the default configuration for tomcat and have not made any modifications.
<% HttpSession ses = request.getSession();
if(ses != null){
user u = (user)ses.getAttribute("theUser");
if(u != null)
{ %>
<input type="hidden" name="userId" value=<%= u.getUserId() %> ><%= u.getUserId() %>
<input type="hidden" name="userName" value=<%= u.getUserName() %> ><%= u.getUserName() %>
<% }
else
{
%>
Please log in.
<%}
} %>