MDL-46099 session: rework incorrect session object referencing