code: private Observable<SessionData> loadSession(final Boolean initialised) {
  
          if (initialised) {
  
              final SessionData session = dataMgr.getSessionDAO().session();
              if (session != null) {
                  if (session.getExpiresOn() > System.currentTimeMillis()) {
                      state.compareAndSet(GlobalState.INITIALISED, GlobalState.SESSION_ACTIVE);
                  } else {
                      state.compareAndSet(GlobalState.INITIALISED, GlobalState.SESSION_OFF);
                      return service.reAuthenticate().onErrorReturn(throwable -> {
                          log.w("Authentication failure during init.");
                          return session;
                      });
                  }
              }
  
              return Observable.create(sub -> {
                  sub.onNext(session);
                  sub.onCompleted();
              });
          }
  
          return Observable.just(null);
      }
docs: Loads local session state.
  
  @return Returns local session state.