Rework the way sessions are destroyed.  Issue #1176