added login and logout methods.