add login and logout support