Refactored cookie dumping