Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Unable to track if the user accept the privacy message using HttpContext.Features.Get

$
0
0

I am working on an asp.net MVC 3.1 web application,and i follow the steps inside this link to activate showing a privacy message @ https://docs.microsoft.com/en-us/aspnet/core/security/gdpr?view=aspnetcore-3.1 .

now inside my Action Method, i want to check if the user accept the privacy alert or not, i tried the following code:-

var consentFeature = HttpContext.Features.Get<ITrackingConsentFeature>();
var canTrack = !consentFeature?.CanTrack ?? false;

but the canTrack will always be false, even if the user accepts the privacy alert. any advice on this please? Thanks


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>