Flush session after edits so that our json reprs have their new ids.