The word “cookie” comes from the Dutch word koekje, which means “little cake,” according to The New Food Lover’s Companion. The first cookie-like “cakes” were thought to have originated in 7th century Persia, one of the earliest countries where sugar was cultivated.
Later, “cookie” became a slang word, and has been used since 1920, according to the Online Etymology Dictionary in phrases like “smart cookie” and “tough cookie.”
The Cambridge International Dictionary of Idioms says that a “smart cookie” is someone who is clever and good at dealing with difficult situations, and that “tough cookie” is someone determined to do what they want and usually succeeds even in difficult situations.
English playwright, actor, and composer, Noel Coward, once wittily translated “smart cookie” into British as “clever biscuit.”
There are other slang usages of the term “cookie.” It’s been used in print since 1920 to mean an attractive woman. It has also been vulgar slang for “vagina” since 1970 in the US. The word “cookies” is used to mean the contents of the stomach, often in reference to vomiting (“pop your cookies,” a 1960s expression, or “toss your cookies,” a 1970s expression). The expression “cookie cutter” is used metaphorically to refer to items or things “having the same configuration or look as many others.” For example, a “cookie cutter tract house,” or to label something as stereotyped or formulaic.
Cookie Monster is a Muppet on the long-running children’s television show Sesame Street who is best known for his voracious appetite for cookies.
The catchphrase “That’s the way the cookie crumbles,” which means “that’s just the way things happen” is attested to in print in 1955. It’s a variant on the expression, “such is life,” which appears to have originated in the 1700s. The French say, “C’est la vie,” and, sometimes, so do we.
All I can say is, that’s the way the ball bounces. Or that’s the way the mop flops.