.net Core 2.1 Session After saving, the new page for less than value

Original: the .NET Core 2.1 Session After saving, the new page for less than value

https://blog.csdn.net/kuui_chiu/article/details/81060051

https://blog.csdn.net/niunan/article/details/80805116

https://stackoverflow.com/questions/49317304/asp-net-core-2-1-session

Configure services to start in class () method, set the options. checkconsent Required = context = false; follows:

services.Configure<CookiePolicyOptions>(options =>
        {
            // This lambda determines whether user consent for non-essential cookies is needed for a given request.
            options.CheckConsentNeeded = context => false; // Default is true, make it false
            options.MinimumSameSitePolicy = SameSiteMode.None;
        });

原因是:
我猜在默认情况下,checkconsent需要是正确的,
这是为了实现GDPR的遵从性。如果您点击了页面顶部的同意弹出(在默认模板的情况下)
,您的会话cookie将按照您的预期开始工作。GDPR规定了cookie的操作方式,
并且在用户同意使用cookie之前不会使用。

这都是Stackoverflow上的回答。同时也感谢本文连接的第一位博主。他让我找到了为什么取不到值的答案。
但是在他们解决办法下并没有说明是什么原因照成的,这就让我百思不得其解的问题。还好Stackoverflow上有。
有时我们解决问题了问题,同时也需要了解原因这样我们才能更好的取学习去进步。不能一味的只是为了解决问题而解决问题。

Guess you like

Origin www.cnblogs.com/lonelyxmas/p/11962469.html