emzero emzero - 1 year ago 84
ASP.NET (C#) Question

How to remove or change ASP.NET MVC 5 default cookie

I've created an

ASP.NET MVC 5
application with "Individual User Accounts" (OWIN). I'm following this guide to remove unnecessary HTTP headers that exposes stuff I don't want to expose.

Everything was removed properly but there's one extra thing that's revealing this is an ASP.NET application which is the default cookie:

Cookie:ASP.NET_SessionId=gpryojsaen2hnukmzoh5xbuv;


Is there a way to change the name to something else?

Answer Source

I neded to add this to the web.config

<system.web>
    <sessionState cookieName="foo" />
</system.web>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download