Writing MODE to cookies