Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conform to and respect GDPR middleware #2

Open
rschindhelm opened this issue Aug 27, 2019 · 1 comment
Open

Conform to and respect GDPR middleware #2

rschindhelm opened this issue Aug 27, 2019 · 1 comment

Comments

@rschindhelm
Copy link

Currently the tag helper disrespects the GDPR middleware by setting the language cookie via JavaScript. The cookie should be set via Response.Cookies.Append instead in order to get processed by the middleware.

Also, we should mark the cookie as essential to ensure it can be set even if the user hasn't given his consensus yet.

This change will ultimately result in the same behavior as if the cookie was set in JavaScript, but the GDPR policies might change in future, so it's presumably better to stay on the safe side.

To extend the Localization.StarterWeb example:

Response.Cookies.Append(
    CookieRequestCultureProvider.DefaultCookieName,
    CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)),
    new CookieOptions {
        Expires = DateTimeOffset.UtcNow.AddYears(1),
        IsEssential = true // mark language cookie as essential
    }
);
@hishamco
Copy link
Owner

Thanks René for filing this issue, I will make a PR for it, and if you like to push a PR you are welcome

thanks again ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants