v.25.7Bug Fix (user-visible misbehavior in an official stable release)

Fix a possible crash

Fix a possible crash in logging while terminating a session as the user_id might sometimes be empty. #82513 (Bharat Nallan).