The sidecar cocktail is believed to be originated in Paris by an American Army captain during World War I. David A. Embury in his 1948 book called "The Fine Art of Mixing Drinks" writes: "[The drink] was named after the motorcycle sidecar in which the good captain was driven to and from the little bistro where the drink was born and christened." Embury states that original Sidecar cocktail had some more ingredients than the modern one has (eventually, they were excluded with time) and was (and actually is) simply a Daiquiri with brandy instead of rum, and with Cointreau instead of sugar syrup as a sweetener.
Sidecars are very popular in France. Its recipes first appeared in America in 1922 in two separate books: "Harry's ABC of Cocktails" by Harry MacElhone and "Cocktails: How to Mix them" by Robert Vermiere. A celebrated bartender of Buck's Club named MacGarry was the one who introduced the drink in London.
To prepare a Sidecar cocktail simply shake two parts of cognac, one part Cointreau and one part of lemon juice with cracked ice; serve in a chilled cocktail glass rimmed with sugar.
It is better to use cognac rather than brandy when preparing a Sidecar. The first reason for this is that even though cognac is actually a kind of brandy, it is much easier to find a good cognac than a good unflavored brandy. Cognac is also preferred since the Sidecar cocktail was originated in France, the birthplace of cognac.
Sugar rim on the Sidecar glass is common since 1934; it was mentioned in three different books: "Burke's Complete Cocktail & Drinking Recipes", "Gordon's Cocktail & Food Recipes" and "Drinks as They Are Mixed".
Here's the quote from "The Fine Art of Mixing Drinks" (1948) by David Embury on the Sidecar cocktail:
"This cocktail is the most perfect example I know of a magnificent drink gone wrong. It was invented by a friend of mine at a bar in Paris during World War I and was named after the motorcycle sidecar in which the good captain customarily was driven to and from the little bistro where the drink was born and christened. As originally concocted it contained some six or seven ingredients in place of the three now set forth in practically all recipe books."