Search code examples
asp.netweb-serviceswcfsessionhttpsession

HttpContext.Current.Session cannot execute parallel wcf service


I try to call parallel request it's working but if I added this line than not work parallel call.

System.Web.HttpContext.Current.Session["UserName"] = "dtest";

Any way to call parallel request with the session?


Solution

  • I was also facing same issue. Below solution helped me.

     if (Context.Request.Path.Contains("xyz.svc"))
     {
           Context.SetSessionStateBehavior(SessionStateBehavior.ReadOnly);
     }
    

    Please try and check if this works.