Add cookie function.