Login/logout almost completed