<%@page import = "java.util.*" session="true"%>
Using Sessions to Track Users
<%
Integer counter = (Integer)session.getAttribute("counter");
if (counter == null) {
counter = new Integer(1);
} else {
counter = new Integer(counter.intValue() + 1);
}
session.setAttribute("counter", counter);
%>
Using Sessions to Track Users
Session ID: <%=session.getId()%>
Session creation time: <%=new Date(session.getCreationTime())%>
Last accessed time: <%=new Date(session.getLastAccessedTime())%>
Number of times you've been here: <%=counter%>