Refactored AutoStartSession() to be simpler with better code reuse.