fix cookie management