update setCookie function in Util