Cookie dough

Cookie dough refers to an un-cooked blend of cookie ingredients. While cookie dough is normally intended to be baked into individual cookies before eating, it is also consumed raw.
Cookie dough can be made at home or bought pre-made in packs (frozen logs, buckets, etc.). Dessert products containing cookie dough include ice cream and candy. In addition, pre-made cookie dough is sold in different flavors.
When made at home, common ingredients include flour, butter, white sugar, salt, vanilla extract, and eggs. If the dough is made with the intention of baking, then leavening agents such as baking soda or baking powder are added. However, these are often excluded in cookie doughs that are designed to be eaten raw. Chocolate chip cookie dough is a popular variation that can be made by adding chocolate chips to the mix.
History.
Cookie dough is derived from the creation of cookies that dates back as far as 7th century Persia, where they were used as test cakes. Persia was one of the first countries to use sugar and soon became known for luxurious cakes and pastries. The early cookie was first labelled as a test cake before it was referred to as a "cookie" because the Persians would bake a small amount of cake batter in the oven to test the oven temperature, and it would come out looking like a mini cake. The concept of cookies spread and became known worldwide. They evolved into biscuits for convenience as they were easier to keep fresh for a longer period and were simple to carry for travel. 
Cookies became established in Europe sometime between the 17th and 18th century, as baking gained popularity. At that time the word "cookie" was first used. The term comes from the Dutch language where Koekje means "small or little cake". During the ensuing industrial revolution, more cookie recipes became available. New forms and flavors of cookies continue to be created, one of which is the concept of edible cookie dough. Ruth Graves Wakefield and Sue Brides owned the Toll House Inn in Whitman, Massachusetts where they created the eponymous chocolate chip cookie in 1938.
As cookies became more popular and people started baking them at home, people would taste the batter to ensure the sweetness of the product. The practice of eating unbaked dough came later, although it comes with potential health problems. 
Health risks.
Because of the presence of raw egg and raw flour, the consumption of uncooked cookie dough increases the possibility of contracting foodborne illness. The U.S. Food and Drug Administration (FDA) strongly discourages the consumption of all food products containing raw eggs or raw flour because of the threat from disease-causing bacteria such as "Salmonella" and "E. coli". Two tablespoons of milk can be swapped for eggs in cookie recipes, and two cups of flour can be microwaved for 50–60 seconds to eliminate bacteria. Leavening, such as baking powder or baking soda, can be removed. Doing so ensures that the cookie dough is safely edible. Cookie dough should be placed in the freezer, but it is considered safe to consume if left out in the open for 2-4 hours. 
Several outbreaks stemmed from pathogens in flour. For example, raw flour was found to be the culprit in a June 2009 "E. coli" outbreak involving Nestlé Toll House prepackaged cookie dough, which was recalled; more than 7,000 people fell ill, although none died. In 2010, Nestle switched to heat-treated processing for all flour used in producing cookie dough. Heat treatment for flour is a simple treatment to kill bacteria. This treatment involves heating the flour in a oven, or heating the flour in a microwave until it gets hot. 
In 2016, General Mills recalled flour and cake mixes because of "E. coli" in the raw flour. In 2015, certain Blue Bell Ice Cream products were recalled due to "Listeria monocytogenes" found in the facility that produces chocolate chip cookie dough and other cookie dough containing flavors.
Edible cookie dough.
Cookie dough designed specifically for eating raw (such as that found in ice cream) is made without raw eggs and uses heat-treated flour.
Companies offering edible dough include "Do", "Edoughable", and "The Cookie Dough Café".
Edible cookie dough, egg-free and made with specially treated flour, became a dessert trend and led to the creation of several businesses. Some sweet shops sell multiple desserts with cookie dough as one option, while others solely create and sell dough. 
Popular culture.
The "cookie dough" flavor, originating in the United States as comfort food, has gained worldwide recognition.