accepted backport for session bug