fixed single cookie function