modify cookie function