Cookies will spread as the fat used in the cookie begins to melt. This generally happens when there hasn't been enough flour used to hold the melted fat. It's important to measure the ingredients accurately.