Swipe the lemon wedge around the entire exterior edge of the glass, to about ½-inch down from the top.
Pour the sugar into a small bowl and firmly plant the lemon-coated side of the glass into the sugar so that the glass is rimmed with ½-inch of sugar.
Pour the rum and Cointreau into the glass.
Using a lighter or long matchstick, carefully light the liquors. Tilt the glass to caramelize the sugar on the rim, which will slowly turn brown and melt.
When the sugar has caramelized, cover the glass with a metal or stone lid to extinguish the flame.
Add the Kahlua and coffee and stir gently.
Add whipping cream to a cocktail shaker and shake vigorously until softly whipped.