fix cookie parsing