Being a Sex and the City writer during the HBO comedy’s blockbuster six-season run was like having magical powers, according to writer Liz Tuccillo. “Suddenly, you could get into any restaurant or club you wanted to . . . at parties, when there was a lull in conversation, you could just sort of slip it in that you worked there. It was really obnoxious but fun.”

There were other, more substantial perks—particularly being in a writers’ room with mostly women, a rarity even 20 years after the show’s 1998 premiere. The show won buckets of awards, including an Emmy for best comedy in 2001 and Golden Globes in that category in 2000, 2001, and 2003. There were invitations to designer shows during Paris Fashion Week, surreal moments like Warren Beatty unceremoniously turning down the show in the most mortifying way possible. (More on that later.) They got V.I.P. treatment from New Yorkers thrilled to see their city recast as a stylish mecca, and unexpected fans like Tom Cruise —who once confessed to a cast member that he had an assistant tape the show and FedEx it to him so he and then-girlfriend Penélope Cruz wouldn’t have to miss out when they were in Europe. Even Senator John McCain had an opinion on whom Carrie should ultimately choose—breathlessly telling writer Amy B. Harris during the series’s final stretch, “Oh, when Carrie touched those diamonds. . . . I knew she’s never going to end up with Petrovsky!”

To write for Sex and the City was to fuel the zeitgeist with story lines inspired by your own heartbreaks and humiliations, metamorphosed in a kind of immaculately art-directed group therapy. The Carrie Bradshaw brain trust wielded such pop-culture power between 1998 and 2004 that Michael “Bones” Buono—the production member tasked with shuttling show-runner Michael Patrick King and most writers from their West Village homes to Silvercup Studios—treated them like especially precious cargo. “I’m a very New York, aggressive driver so I love to yell, honk, bob, and weave,” he said. “But I was really conscious not to do that with them. They were like New York royalty. And I felt a huge responsibility for them just to be safe.”

THE ROOM WHERE IT HAPPENED

Carrie, Samantha, Charlotte, and Miranda were sexy, capable, whip-smart women who could juggle conversation about vibrators, death, and the drudgery of single life in the span of 30 seconds. For Michael Patrick King, who ran the show during its final four seasons, it was crucial his writers be similar.

“The people that I hired were all sort of in this same emotional place as the four characters. At one point, everyone was single, living in New York, and feeling like an outsider,” he said. “That’s why the show felt authentic.”

Despite the many perks, there was an occupational hazard to being a female writer on Sex and the City—aside from the porn pop-up ads they’d have to explain as “work-related” to their I.T. team.

“My joke was the show should be called, No Sex and the City,” said Harris. “The hours were long, so that alone made it hard to date.” Men also tended to fall into two camps: social climbers and men who feared that their foibles would be shared in the writers’ room. “You would say no [you weren’t talking about them in the writers’ room], but of course you were.”

“Or people would talk to you in a very frank way because that’s the way the characters do on the show,” said writer Cindy Chupack. “When we did that episode about Mr. Pussy”—the orally fixated character Charlotte dates in Season 2’s “The Freak Show”—“there were too many men who were eager to tell us that was them.” (Not all over-sharers were potential romantic interests, either: according to Tuccillo, “a very high-up television executive at the time sat down next to us and told us how much he enjoyed giving women oral sex.”) Some men assumed that the women who scripted Samantha were as sexually adventurous as the character—like one who went out with writer Jenny Bicks after she got a Brazilian bikini wax as research, at a time when the grooming craze hadn’t yet widely caught on. “When I told one of the guys that I went out on a date with what happened, he literally could not get me home fast enough.”