Melt butter in a large soup pot over medium heat. Add onion and stir to coat. Reduce heat to low; cover and cook 15 minutes.
Meanwhile, make the toasted bread cubes (croutons): Preheat oven to 400°F.
Line a baking sheet with parchment paper and spread bread cubes in a single layer. Bake until crisp and golden brown, 15 to 20 minutes. Remove from oven and set aside.
Uncover onions and stir in salt and sugar. Raise heat to medium-low; cook 30 to 40 minutes, stirring often until onions have caramelized to a deep golden brown. Add flour; cook and stir 3 minutes to remove flour taste.
Add thyme, wine and broth to onion mixture and stir. Increase heat to medium and bring to simmer. Let simmer, stirring occasionally, 30 to 40 minutes to your desired taste and consistency. Remove from heat and stir in Cognac. Add salt and pepper to taste
Ladle soup into 6 broiler-safe individual serving bowls. Top each bowl with 1/6 each of the toasted bread cubes and shredded cheese. Arrange bowls on a baking sheet and place under broiler. Broil until cheese is melted and bubbly. Serve.
If you don't want 6 servings of this soup at once, no problem! Make the full recipe of onion soup, but prepare just enough bread and cheese for the number of servings you want. Then reheat the leftover soup as needed, finishing with bread and cheese.