Fix cookie management