The phrase "tossing cookies" or "to toss one's cookies" is a slang expression that means to vomit or to throw up. It is believed to have originated in the United States in the mid-20th century, specifically in the 1960s or 1970s.
The exact etymology of the phrase is uncertain, but there are a few theories. One possibility is that the word "toss" refers to the act of physically throwing up, while "cookies" refers to chunks of partially digested food that can resemble cookies. So, "tossing cookies" would metaphorically mean throwing up food.
Another theory suggests that "tossing cookies" could be a play on words, with "cookies" representing a rhyming alteration of "kookies", a term used in the mid-20th century to refer to marijuana.