To prevent cookies from spreading too much and losing their shape, choose a recipe made without baking soda or baking powder. Always make sure the dough is thoroughly chilled before you bake it, and always bake on an ungreased baking sheet.