Write and modify cookie files