To prevent cookies from spreading when baking, refrigerate the dough and the baking sheet for a couple of minutes before baking.