diff --git a/src/helma/framework/core/Session.java b/src/helma/framework/core/Session.java index 4c1530a7..5a4e342d 100644 --- a/src/helma/framework/core/Session.java +++ b/src/helma/framework/core/Session.java @@ -30,7 +30,7 @@ public class Session implements Serializable { // this stays the same across logins and logouts. public TransientNode cacheNode; - long onSince, lastTouched; + long onSince, lastTouched, lastModified; // used to remember messages to the user between requests - // used for redirects. @@ -43,7 +43,7 @@ public class Session implements Serializable { this.userHandle = null; cacheNode = new TransientNode ("session"); onSince = System.currentTimeMillis (); - lastTouched = onSince; + lastTouched = lastModified = onSince; } /** @@ -57,6 +57,7 @@ public class Session implements Serializable { userHandle = ((Node)usernode).getHandle(); uid = usernode.getElementName(); } + lastModified = System.currentTimeMillis (); } /** @@ -65,6 +66,7 @@ public class Session implements Serializable { public void logout() { userHandle = null; uid = null; + lastModified = System.currentTimeMillis (); } public boolean isLoggedIn() { @@ -108,6 +110,15 @@ public class Session implements Serializable { return lastTouched; } + public long lastModified () { + return lastModified; + } + + public void setLastModified (Date date) { + if (date != null) + lastModified = date.getTime (); + } + public long onSince () { return onSince; } diff --git a/src/helma/framework/core/SessionBean.java b/src/helma/framework/core/SessionBean.java index 388aca81..35f1c175 100644 --- a/src/helma/framework/core/SessionBean.java +++ b/src/helma/framework/core/SessionBean.java @@ -66,6 +66,14 @@ public class SessionBean implements Serializable { public Date getonSince() { return new Date (session.onSince ()); } + + public Date getLastModified () { + return new Date (session.lastModified ()); + } + + public void setLastModified (Date date) { + session.setLastModified (date); + } }