I got this superb recipe from Emeril's show on French cooking. I just adore French onion soup, and haven't been able to find a recipe I liked, until I came across this one. This is a lot of work, but trust me, it is well worth the effort!
In a Dutch oven or other large, heavy pot, melt the butter over medium-high heat. Add the onions, salt and pepper, and cook, stirring, until golden brown, 15 to 18 minutes.
Remove the pan from the heat and carefully add the cognac.
Return the pan to the heat and cook until the alcohol has evaporated. Be careful as the cognac may ignite.
Add the beef stock and thyme sprigs and bring to a boil. Reduce the heat to a simmer and cook the soup for 45 minutes.
While the soup is simmering, toast the bread slices until light golden brown. Remove from the oven.
Preheat the broiler.
When the soup is ready, divide 1/2 of the toasted bread slices between 6 individual oven proof serving bowls or crocks and top with 1/2 of the grated cheese.
Ladle some of the soup among the bowls and top with the remaining toasts.
Ladle the remaining soup among the bowls and top with the remaining cheese.
Place the bowls on a baking sheet and place under the broiler until the cheese is melted, golden brown and bubbly, about 5 minutes.
Remove from the oven.
In a small bowl combine the egg yolks and Port and whisk to thoroughly combine. Pour some of the mixture evenly among the soup bowls, stirring in around the edges so that it is incorporated into the soup. (The heat of the soup will cook the egg yolk and this will thicken and enrich the soup.)
Garnish the top with chopped parsley and serve hot.