cookie (n.) Look up cookie at Dictionary.com
1703, American English, from Dutch koekje "little cake," diminutive of koek "cake," from Middle Dutch koke (see cake (n.)). Slang application to persons attested since 1920. Phrase that's the way the cookie crumbles "that's the way things happen" is from 1957.