Put 40 g sugar with 2 tablespoons of water in a pot and cook to a golden brown caramel. Add port wine and 5 tablespoons of water. Wash the thyme and rosemary. Simmer in the port wine for about 10 minutes at medium heat.
Season with vinegar, 1 pinch of sugar and salt. In the meantime peel and halve the shallots. Brush the baking tray with oil and sprinkle with salt and 1 teaspoon sugar. Put shallots on the baking tray and season with salt, pepper and 1 teaspoon sugar.
Bake in the preheated oven (electric cooker: 200 °C/ convection oven: 175 °C/ gas: level 3) for about 20 minutes. Bring the stock to the boil again, fill the shallots evenly into the clean twist-off glasses, pour on the stock, seal well and place on the lid for approx. 5 minutes.
Store cooled glasses in the refrigerator. Shelf life 7-10 days. Shallots taste great with cheese and meat, for example.