If ever a drink symbolized a specific time, it is the bright pink, citric Cosmopolitan. That time was the 1990s. It was the drink to be seen with. In New York people drank Cosmopolitans by the trayload in the elevated Rainbow Room bar inside the Rockefeller Center. One photo of Madonna enjoying a Cosmo on a night out, coupled with the weekly cocktail-drinking adventures of Carrie Bradshaw and her friends in Sex and the City, was all it took to make the drink a phenomenon.

Its story begins as recently as 1968. Marketing men for the company Ocean Spray were looking for a way to bring their cranberry juice to the adult market, so on every carton they printed a recipe for a new cocktail called the Harpoon. This consisted of vodka, cranberry juice, and lime and it may have lacked finesse, but it was enough to encourage barmen to start experimenting. Of the number of people who are credited with bringing a cranberry-flavored cocktail to a wider audience, the main player appears to be a bartender named Cheryl Cook, working in South Beach, Florida, in the late 1970s. She noticed that her customers wanted to be seen drinking something sophisticated like a Martini, but that in fact it was too sour for them. So she decided to create a cocktail that would suit the Miami crowd. She used lemon-infused vodka and triple sec combined with lime for sharpness and sweetened it with just enough cranberry juice to make it pretty. She says she chose the name as a direct link to the magazine Cosmopolitan, whose style and design she was trying to reflect.

Cook’s role in the history of the Cosmopolitan is constantly disputed—some say she didn’t even exist—but one man who can be pinpointed for helping the drink’s global domination was John Caine. He came across variations while working the bars of Provincetown, Massachusetts, which in the 1970s was a popular destination among emerging gay communities. Provincetown is not far from one of the main cranberry-producing areas in America, and the Cosmopolitan had become incredibly popular as a way of using the local juice.

When Caine left to start his own bar in San Francisco a few years later, he took the drink with him. The Cosmopolitan became widely known in trendy bars in Frisco at a time when its gay population was enjoying a new sexual freedom. People hung out, drinking, smoking, and having fun. It was during this time that the drink began to creep into popular culture. The writings of Armistead Maupin described the San Francisco social scene and soon the Cosmo had spread across the country, eventually making its way to New York and into those Sex and the City girls’ glasses. The current version of the Cosmopolitan is credited to one of two bartenders, Dale Degroff at the Rainbow Rooms or Toby Cecchini at the Odeon in Tribeca. Both tweaked Cook’s original mix, switching from lime cordial to fresh lime and insisting on Absolut Citron as their vodka of choice. Their changes stuck and Madonna’s seal of approval did the rest.