If a cheese or other foodstuff is spreadable, like cream cheese, peanut butter, ranch dressing, or Nutella, then traveling with it in your carry-on means packing in line with that 3-1-1 liquids rule explained above (unless it's already in a sandwich, in which case you should be fine.)