withProgress: check that `session` is a session object