Heat the oil in a large nonstick saucepan or flameproof casserole. Add the onions, cover with a lid and cook over a low heat for 25 minutes, stirring occasionally until the onions are very soft. Remove the lid, increase the heat and cook for a further 15 minutes until the onions have turned a rich golden brown colour, stirring frequently and making sure that the onions do not burn.
Pour the stock over the onions, bring to a simmer, cover the pan with a lid once more and cook for 15 minutes. Mix the cornflour with the water in a small bowl to make a smooth paste. Pour the liquid into the pan, stir well and cook for a further two minutes uncovered until the soup thickens slightly. Season to taste with salt and pepper and keep warm over a low heat.
Heat the grill to the highest setting. Trim each end off the baguette and cut into 12 slices, each around 1 cm thick. Place the slices on a baking tray and toast close to the grill for 1 minute on each side until lightly browned. Remove from under the grill and sprinkle a little of the grated cheese on each slice of bread. Replace the toast under the grill and cook for 30-60 seconds until the cheese melts and is beginning to brown. Ladle the hot soup into deep bowls and top each one with two pieces of the cheesy toast. Sprinkle with tiny sprigs of thyme just before serving.
See more French recipes.