adjusted how the automatic cookie detection happens