fix cookie encode bug