Subscribe to login / logout changes. The listener is invoked immediately with the current state, then again on every change. Returns an unsubscribe fn.