Improve CookieSet functionality