450467 Integer overflow in Session expiry calculation in MongoSessionManager

This commit is contained in:
Jan Bartel 2014-11-12 16:26:14 +11:00
parent e0fbd6d9f2
commit f10403b41a
2 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ public abstract class NoSqlSessionManager extends AbstractSessionManager impleme
__log.debug("session loaded ", idInCluster);
//check if the session we just loaded has actually expired, maybe while we weren't running
if (getMaxInactiveInterval() > 0 && session.getAccessed() > 0 && ((getMaxInactiveInterval()*1000)+session.getAccessed()) < System.currentTimeMillis())
if (getMaxInactiveInterval() > 0 && session.getAccessed() > 0 && ((getMaxInactiveInterval()*1000L)+session.getAccessed()) < System.currentTimeMillis())
{
__log.debug("session expired ", idInCluster);
expire(idInCluster);

View File

@ -237,7 +237,7 @@ public class MongoSessionManager extends NoSqlSessionManager
// handle valid or invalid
if (session.isValid())
{
long expiry = (session.getMaxInactiveInterval() > 0?(session.getAccessed()+(1000*getMaxInactiveInterval())):0);
long expiry = (session.getMaxInactiveInterval() > 0?(session.getAccessed()+(1000L*getMaxInactiveInterval())):0);
__log.debug("MongoSessionManager: calculated expiry {} for session {}", expiry, session.getId());
// handle new or existing