Set session when removing last item. Closes #3739