cookie string and dict convert methods