示例#1
0
        public async Task <IActionResult> CookieManager()
        {
            if (!_privacySettings.EnableCookieConsent)
            {
                return(new EmptyResult());
            }

            // If current country doesn't need cookie consent, don't display cookie manager.
            if (!await DisplayForCountryAsync())
            {
                return(new EmptyResult());
            }

            var cookieData = _cookieConsentManager.GetCookieData();

            if (cookieData != null && !HttpContext.Request.IsAjaxRequest())
            {
                return(new EmptyResult());
            }

            var model = new CookieManagerModel();

            await PrepareCookieManagerModelAsync(model);

            return(PartialView(model));
        }
        public async Task <IActionResult> CookieManager()
        {
            if (!_privacySettings.EnableCookieConsent)
            {
                return(new EmptyResult());
            }

            // If current country doesn't need cookie consent, don't display cookie manager.
            if (!await DisplayForCountryAsync())
            {
                return(new EmptyResult());
            }

            var cookieData = _cookieConsentManager.GetCookieData();

            if (cookieData != null && !HttpContext.Request.IsAjaxRequest())
            {
                return(new EmptyResult());
            }

            var model = new CookieManagerModel();

            await PrepareCookieManagerModelAsync(model);

            // TODO: (mh) (core) Why is this a partial? Are you sure? Please analyze CookieConsentFilter in classic.
            return(PartialView(model));
        }