From 6d7820612e894f07b809f63691171852d7592cd3 Mon Sep 17 00:00:00 2001 From: rjung Date: Wed, 5 Nov 2008 21:56:52 +0000 Subject: [PATCH] Give thisAccessedTime and lastAccessedTime for sessions a clear semantics: - thisAccessedTime will be updated at the beginning and at the end of session use - lastAccessedTime will only be updated at the end of session use This means: - lastAccessedTime is the last access time of a session disregarding any request still being processed on. So this is good to use even from within a request to detect when its own session has been used last before. - thisAccessedTime already gets updated when a new request disregarding any request still being processed on. So this is better for any idleness check or information. - thisAccessedTime >= lastAccessedTime always git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@711711 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/session/StandardSession.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/org/apache/catalina/session/StandardSession.java b/java/org/apache/catalina/session/StandardSession.java index 8659dc372..1d7221091 100644 --- a/java/org/apache/catalina/session/StandardSession.java +++ b/java/org/apache/catalina/session/StandardSession.java @@ -617,9 +617,8 @@ public class StandardSession */ public void access() { - this.lastAccessedTime = this.thisAccessedTime; this.thisAccessedTime = System.currentTimeMillis(); - + if (ACTIVITY_CHECK) { accessCount.incrementAndGet(); } @@ -633,6 +632,8 @@ public class StandardSession public void endAccess() { isNew = false; + this.thisAccessedTime = System.currentTimeMillis(); + this.lastAccessedTime = this.thisAccessedTime; if (ACTIVITY_CHECK) { accessCount.decrementAndGet(); -- 2.11.0