In a large dutch oven or sauté pan, melt butter over medium-high heat until foaming. Add onions and 1/4 teaspoon kosher salt. Cover and cook, stirring occasionally, until softened, about 8 minutes. Remove the cover and lower heat to medium-low and cook, stirring frequently, until onions are very soft and a rich, golden brown color, 1 to 1 1/2 hours. During this time, if the bottom of the pot develops a crust that threatens to burn, add 1 tablespoon of water, scrape up the browned bits, and continue cooking. You may need to do this several times, especially towards the end of the process.
Raise heat to medium-high, add sherry and cognac and bring to a simmer, scraping up any browned bits. Cook until mostly reduced, about 5 minutes. Add wine and simmer for 15 minutes more. Add stock, thyme, and bay leaf and bring to a boil. Lower heat and simmer for 20 minutes.
Add fish sauce, if using, and season with salt and pepper. Discard thyme stems and bay leaf.
Preheat broiler and position oven rack to top position. Toast the baguette slices and while the bread is still warm, rub the surface of one side with the cut end of the garlic clove. Spread a thin layer of butter over the garlic toasts (if you want, you can cut each slice in half to make them easier to fit in the bowls).
Spoon a small amount of soup into the bottoms of 4 oven-proof serving bowls, then top with half the toasts. Sprinkle some grated cheese on top of toasts, then spoon more soup on top, nearly filling the bowls. Set the remaining toasts in each bowl, pushing to nearly submerge them. Top with remaining grated cheese and set bowls on a rimmed baking sheet. Broil until cheese is melted and browned in spots. Garnish with chives and serve.