getting the login/logout function working more completely