Abstracted cookie saving into factory