Peel onions and cut them into thin rings with a sharp knife or slice them into fine rings on a vegetable grater. Heat the oil in a large pot. Fry the onions in it at low heat while stirring for about 10 minutes until transparent, but do not brown.
Sprinkle flour over the onions and sauté lightly. Pour wine and 1 l water, stir in the stock. Season with salt and pepper. Bring to the boil and simmer covered for about 20 minutes.
Preheat oven (electric cooker: 225 °C/circulating air: 200 °C/gas: level 4). Cut baguette into 6 thin slices and toast in toaster until golden brown. Grate cheese finely.
Season soup with salt and pepper, if necessary refine with cognac. Fill half of the soup into ovenproof soup cups or plates. Place 1 slice of baguette on each and pour some of the stock over the slices.
Sprinkle with cheese and bake in a hot oven for 5-7 minutes. If you don't have ovenproof cups, you can cook the soup in a casserole dish, cover it with baguette, sprinkle cheese on top and gratinate. Then arrange in portions.