code: protected void checkValidForRead() throws IllegalStateException {
          checkLocked();
  
          if (state == State.INVALID) {
              throw new IllegalStateException("Invalid for read: session " + this);
          }
          if (state == State.INVALIDATING) {
              return;
          }
          if (!isResident()) {
              throw new IllegalStateException("Invalid for read: session " + this);
          }
      }
docs: Check that the session data can be read.
  
  @throws IllegalStateException if the session is invalid