cookies for web api are not transmitted, everything works for mvc.

FormsAuthentication.SetAuthCookie (model.Email, true);

the request from the client is transmitted via jquery ajax

var serviceId = $('#Id').val(); $.ajax({ method: 'GET', url: '@Url.RouteUrl("DefaultApi", new { httproute = "", controller = "Number" })' + '?serviceId=' + serviceId }) 

    1 answer 1

      public static void Register(HttpConfiguration config) { // Web API configuration and services // Configure Web API to use only bearer token authentication. config.SuppressDefaultHostAuthentication(); config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType)); 

    that's because it did not work