fix cookie encoding