AspNet Core Identity, how set options.Cookie.SameSite?

后端 未结 3 996
没有蜡笔的小新
没有蜡笔的小新 2021-01-04 11:07

In the latest templates and libraries used httpsonly flag. How can I turn it off?

This same question is outdated and it did not have full configuration sample:

3条回答
  •  失恋的感觉
    2021-01-04 11:45

    For my case in asp.net core 3.1 two things in combination did the trick

    services.ConfigureApplicationCookie(options =>
            {
                options.Cookie.SameSite = SameSiteMode.Unspecified;
            });
    
            services.AddAntiforgery(opts => {
                opts.Cookie.SameSite = SameSiteMode.Unspecified;
            });
    

提交回复
热议问题