* @return The distSession value
*/
private MetaHttpSession getDistSession( HttpServletRequest req )
{
log.info( "in getSession" );
DistSession sess = null;
String session_id = getRequestedSessionId( req );
if ( session_id == null )
{
log.info( "no cookie found" );
return new MetaHttpSession( null, null );
}
sess = new DistSession();
if ( !sess.init( session_id ) )
{
return new MetaHttpSession( session_id, null );
}
long idleTime = System.currentTimeMillis() - sess.getLastAccessedTime();
int max = sess.getMaxInactiveInterval();
if ( idleTime > max / 2 )
{
if ( idleTime < max )
{
sess.access();
}
else
{
sessIdSet.remove( session_id );
sess.invalidate();
return new MetaHttpSession( session_id, null );
}
}
return new MetaHttpSession( session_id, sess );
}