Set/read cookies with standardized function