Use spec compliant session expiration in STRICT_SERVLET_COMPLIANCE mode.
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 11 Apr 2010 20:51:16 +0000 (20:51 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 11 Apr 2010 20:51:16 +0000 (20:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@932989 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/session/StandardSession.java

index 3d9b330..0770329 100644 (file)
@@ -598,7 +598,12 @@ public class StandardSession
 
         if (maxInactiveInterval >= 0) { 
             long timeNow = System.currentTimeMillis();
-            int timeIdle = (int) ((timeNow - thisAccessedTime) / 1000L);
+            int timeIdle;
+            if (Globals.STRICT_SERVLET_COMPLIANCE) {
+                timeIdle = (int) ((timeNow - lastAccessedTime) / 1000L);
+            } else {
+                timeIdle = (int) ((timeNow - thisAccessedTime) / 1000L);
+            }
             if (timeIdle >= maxInactiveInterval) {
                 expire(true);
             }