Search code examples
c#.netweb-serviceswcfwcf-data-services

Session support in self-hosted WCF Data Service


I created a self-hosted WCF data service and as you can see here, I discovered that it does not support the ASP.Net context (HttpContext.Current is null).

Am I correct if I suppose that session handling is also not available in a self-hosted data service?


Solution

  • Session handling is not available in self-hosted WCF Data Services as it utilizies the HttpContext class which relies on ASP.Net context and it is always null in Data Services. So you have to implement a custom solution to imitate session handling in WCF Data Services.