Merge "session: Fix a use-after-free bug." into rvc-dev am: f490e3fe2a

Change-Id: If5436b4c899337852902c8127a1fcc227abe41e8