I have a ASP.NET WebForms application which also has API code. This project is not MVC based, its just WebForms.
The API is a seperate class with WebMethods, which is being routed to via the following code in Application_Start (file Global.asax.cs)
protected void Application_Start(object sender, EventArgs e)
{
log4net.Config.XmlConfigurator.Configure();
RouteTable.Routes.Add(new ServiceRoute("api/v1", new WebServiceHostFactory(), typeof(API.v1.Api)));
}
Everything works fine, once a request comes in to domain.com/api/v1/... it will be routed to my Api class. But my application is always responding with the "Set-Cookie" Header even when on the Api route. I'm not using the Session context anywhere in the Api class.
How can i disable Cookie entirely for everything within /api while at the root of the application cookie still runs as usual? Is that even possible?