Implement login & logout.