public boolean isValid(){
  if (!isValid) {
    return false;
  }
  if (getMaxInactiveInterval() >= 0) {
    long now=System.currentTimeMillis();
    if (now - attributes.getLastAccessedTime() >= getMaxInactiveInterval() * 1000) {
      return false;
    }
  }
  return true;
}

public boolean isValid ( ) { if ( ! isValid ) { return false ; } if ( getMaxInactiveInterval ( ) >= 0 ) { long now = System . currentTimeMillis ( ) ; if ( now - attributes . getLastAccessedTime ( ) >= getMaxInactiveInterval ( ) * 1000 ) { return false ; } } return true ; }
determine whether the session is still valid or whether it has expired .
