<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%> <%@ page import="java.text.*"%> <%@ page import="java.util.*"%> <% String RsessionId = request.getRequestedSessionId(); String sessionId = session.getId(); boolean isNew = session.isNew(); long creationTime = session.getCreationTime(); long lastAccessedTime = session.getLastAccessedTime(); int maxInactiveInterval = session.getMaxInactiveInterval(); Enumeration e = session.getAttributeNames(); %> Session Test <% String name = null; while (e.hasMoreElements()) { name = (String) e.nextElement(); %> <% } %>
Session Info
Server HostName <%=java.net.InetAddress.getLocalHost().getHostName()%>
Server IP <%=java.net.InetAddress.getLocalHost() .getHostAddress()%>
Request SessionID <%=RsessionId%>
SessionID <%=sessionId%>
isNew <%=isNew%>
Creation Time <%=new Date(creationTime)%>
Last Accessed Time <%=new Date(lastAccessedTime)%>
Max Inactive Interval (second) <%=maxInactiveInterval%>
Session Value List
NAME VAULE
<%=name%> <%=session.getAttribute(name)%>
<% int count = 0; if(session.getAttribute("count") != null) count = (Integer) session.getAttribute("count"); count += 1; session.setAttribute("count", count); out.println(session.getId() + " : " + count); %>