Updated code for cookies chapter