Test and fix for #252 (disappearing sessions)