cookie detection wrapper