How to modify .Aspnetcore.Identity.Application Cookie name?

Zang-Ho Bae 26 Reputation points
2021-01-05T11:10:14.757+00:00

I wanna hide that i use ASP.NET Core.

How to do this?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,346 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 50,591 Reputation points
    2021-01-05T15:13:31.787+00:00

    Can you not just set the cookie name as part of your AddAuthentication call?

    csharp
    services.AddAuthentication()
                .AddCookie(options => {
       options.CookieName = "MyAuth.Cookie"
    });
    
    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Michael Taylor 50,591 Reputation points
    2021-01-06T16:17:56.2+00:00

    .NET 5 is just .NET Core 4 renamed to avoid confusion. What is the cookie name you're seeing?


  2. hasan hüseyin topal 0 Reputation points
    2024-06-13T03:37:16.9333333+00:00

    I dont know why but you cant rename cookie name with AddCookie(options...) you have to do

    builder.Services.ConfigureApplicationCookie(opt =>{
    opt.Cookie.Name = "YourCookieName";
    });
    
    0 comments No comments