add login/logout support