Changed cookie to read/write to align with JS api