protected static final boolean ACTIVITY_CHECK;
+ protected static final boolean LAST_ACCESS_AT_START;
static {
- STRICT_SERVLET_COMPLIANCE = Boolean.valueOf(System.getProperty(
- "org.apache.catalina.STRICT_SERVLET_COMPLIANCE",
- "false")).booleanValue();
+ STRICT_SERVLET_COMPLIANCE = Globals.STRICT_SERVLET_COMPLIANCE;
String activityCheck = System.getProperty(
"org.apache.catalina.session.StandardSession.ACTIVITY_CHECK");
ACTIVITY_CHECK =
Boolean.valueOf(activityCheck).booleanValue();
}
+
+ String lastAccessAtStart = System.getProperty(
+ "org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START");
+ if (lastAccessAtStart == null) {
+ LAST_ACCESS_AT_START = STRICT_SERVLET_COMPLIANCE;
+ } else {
+ LAST_ACCESS_AT_START =
+ Boolean.valueOf(lastAccessAtStart).booleanValue();
+ }
}
if (maxInactiveInterval >= 0) {
long timeNow = System.currentTimeMillis();
int timeIdle;
- if (Globals.STRICT_SERVLET_COMPLIANCE) {
+ if (LAST_ACCESS_AT_START) {
timeIdle = (int) ((timeNow - lastAccessedTime) / 1000L);
} else {
timeIdle = (int) ((timeNow - thisAccessedTime) / 1000L);
* The servlet spec mandates to ignore request handling time
* in lastAccessedTime.
*/
- if (Globals.STRICT_SERVLET_COMPLIANCE) {
+ if (LAST_ACCESS_AT_START) {
this.lastAccessedTime = this.thisAccessedTime;
this.thisAccessedTime = System.currentTimeMillis();
} else {
<li><code>org.apache.catalina.core.ApplicationDispatcher.WRAP_SAME_OBJECT</code></li>
<li><code>org.apache.catalina.core.StandardHostValve.ACCESS_SESSION</code></li>
<li><code>org.apache.catalina.session.StandardSession.ACTIVITY_CHECK</code></li>
+ <li><code>org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START</code></li>
<li><code>org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES</code>.</li>
<li><code>org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR</code>.</li>
<li><code>org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING</code>.</li>
else the default value will be <code>false</code>.</p>
</property>
+ <property
+ name="org.apache.catalina.session. StandardSession.LAST_ACCESS_AT_START">
+ <p>If this is <code>true</code>, the last accessed time for sessions will
+ be calculated from the beginning of the previous request. If
+ <code>false</code>, the last accessed time for sessions will be calculated
+ from the end of the previous request. This also affects how the idle time
+ is calculated. If
+ <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code> is set to
+ <code>true</code>, the default of this setting will be <code>true</code>,
+ else the default value will be <code>false</code>.</p>
+ </property>
+
</properties>
</section>