State machine for AppSessions