statechart with login/logout