S
Sameer
Hello All,
I have a simple JSP which looks like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<%@ page session="true"%>
<HTML>
<HEAD>
<meta HTTP-EQUIV="refresh" CONTENT="35">
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Pragma content=no-cache>
</HEAD>
<BODY>
<%
Object sessionIteratorAsObj = null;
int sessionIterator;
sessionIteratorAsObj = session.getValue("sessionIterator");
if (sessionIteratorAsObj == null) {
sessionIterator = 0;
} else {
Integer tmpInteger = (Integer) sessionIteratorAsObj;
sessionIterator = tmpInteger.intValue();
}
sessionIterator++;
out.println("<p>" + new java.util.Date() + " <p>");
out.println("Session = " + session);
out.println("<p>session accessed '" +sessionIterator+ "' times.</p>");
out.println("<p>Max session idle time in secs = "
+session.getMaxInactiveInterval()+ "</p>");
session.putValue("sessionIterator", new Integer(sessionIterator)); %>
</BODY> </HTML>
This page accesses the session every time it is invoked. The session timeout
is set to 60 seconds. What I have observed is that, If the page refresh
interval is set to less than 30 seconds, then session lives for a long time,
but if it is longer then session is dropped frequently.
Does this mean, it is not sufficient to access session only once during
timeout period to avoid timeout? I was under the impression that tomcat 4
would restart the 60 seconds timer after every access to session.
Thanks,
Sameer.
I have a simple JSP which looks like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<%@ page session="true"%>
<HTML>
<HEAD>
<meta HTTP-EQUIV="refresh" CONTENT="35">
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Pragma content=no-cache>
</HEAD>
<BODY>
<%
Object sessionIteratorAsObj = null;
int sessionIterator;
sessionIteratorAsObj = session.getValue("sessionIterator");
if (sessionIteratorAsObj == null) {
sessionIterator = 0;
} else {
Integer tmpInteger = (Integer) sessionIteratorAsObj;
sessionIterator = tmpInteger.intValue();
}
sessionIterator++;
out.println("<p>" + new java.util.Date() + " <p>");
out.println("Session = " + session);
out.println("<p>session accessed '" +sessionIterator+ "' times.</p>");
out.println("<p>Max session idle time in secs = "
+session.getMaxInactiveInterval()+ "</p>");
session.putValue("sessionIterator", new Integer(sessionIterator)); %>
</BODY> </HTML>
This page accesses the session every time it is invoked. The session timeout
is set to 60 seconds. What I have observed is that, If the page refresh
interval is set to less than 30 seconds, then session lives for a long time,
but if it is longer then session is dropped frequently.
Does this mean, it is not sufficient to access session only once during
timeout period to avoid timeout? I was under the impression that tomcat 4
would restart the 60 seconds timer after every access to session.
Thanks,
Sameer.