Move cookie getter and setter to utils