【发布时间】:2021-04-11 03:21:40
【问题描述】:
我想隐藏我使用 ASP.NET Core。 Cookie 名称表明我使用 ASP.NET Core 和 Identity。 所以,我会修改Cookie名称,我不知道怎么做。 这个怎么做? 请有人帮助我。
【问题讨论】:
标签: asp.net-core authentication cookies .net-core asp.net-identity
我想隐藏我使用 ASP.NET Core。 Cookie 名称表明我使用 ASP.NET Core 和 Identity。 所以,我会修改Cookie名称,我不知道怎么做。 这个怎么做? 请有人帮助我。
【问题讨论】:
标签: asp.net-core authentication cookies .net-core asp.net-identity
我解决了这个问题。
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.ConfigureApplicationCookie(options =>
{
options.Cookie.Name = "MyCustomCookieName";
});
}
}
这从 .NET Core 3.1 开始有效。
【讨论】: