Melt the butter and oil together in the bottom of a 4- to 5-quart saucepan or Dutch oven over moderately low heat. Add the onions, toss to coat them in oil and cover the pot. Reduce the heat to real low and let them slowly steep for 15 minutes.
After 15 minutes, uncover the pot, raise the heat slightly and stir in the salt and sugar. Cook onions, stirring frequently, for 30 to 40 minutes until they have turned an even, deep golden brown. Don’t skimp on this step, as it will build the complex and intense flavor base that will carry the rest of the soup. Plus, from here on out, it will be a cinch.
After the onions are fully caramelized, sprinkle them with flour and cook, stirring, for 3 minutes. Add the wine in full, then stock, a little at a time, stirring between additions. Season to taste with salt and pepper. Bring to a simmer and simmer partially covered for 30 to 40 more minutes, skimming if needed. Correct seasonings if needed but go easy on the salt as the cheese will add a bit more saltiness and I often accidentally overdo it. Stir in the cognac, if using. I didn’t use any, but Deb likes to.