minor improvements to cookie utils