Issue #1070
This commit is contained in:
parent
5395cfd021
commit
f79d7cfe20
|
@ -232,8 +232,7 @@ public class Session implements SessionHandler.SessionIf
|
|||
long lastAccessed = _sessionData.getAccessed();
|
||||
_sessionData.setAccessed(time);
|
||||
_sessionData.setLastAccessed(lastAccessed);
|
||||
int maxInterval=getMaxInactiveInterval();
|
||||
_sessionData.setExpiry(maxInterval <= 0 ? 0 : (time + maxInterval*1000L));
|
||||
_sessionData.calcAndSetExpiry(time);
|
||||
if (isExpiredAt(time))
|
||||
{
|
||||
invalidate();
|
||||
|
|
|
@ -251,6 +251,16 @@ public class SessionData implements Serializable
|
|||
return (getMaxInactiveMs() <= 0 ? 0 : (System.currentTimeMillis() + getMaxInactiveMs()));
|
||||
}
|
||||
|
||||
public long calcExpiry (long time)
|
||||
{
|
||||
return (getMaxInactiveMs() <= 0 ? 0 : (time + getMaxInactiveMs()));
|
||||
}
|
||||
|
||||
public void calcAndSetExpiry (long time)
|
||||
{
|
||||
setExpiry(calcExpiry(time));
|
||||
}
|
||||
|
||||
public void calcAndSetExpiry ()
|
||||
{
|
||||
setExpiry(calcExpiry());
|
||||
|
@ -351,8 +361,8 @@ public class SessionData implements Serializable
|
|||
public boolean isExpiredAt (long time)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Testing expiry on session {}: expires at {} now {}", _id, getExpiry(), time);
|
||||
if (getExpiry() <= 0)
|
||||
LOG.debug("Testing expiry on session {}: expires at {} now {} maxIdle {}", _id, getExpiry(), time, getMaxInactiveMs());
|
||||
if (getMaxInactiveMs() <= 0)
|
||||
return false; //never expires
|
||||
return (getExpiry() <= time);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue