Fix inconsistency on session boundaries (#12255)