setting cookie if not found