Cookie handling fix