Sunday, December 5, 2010

WCF and ASP.NET compatibility - the missing bit

Actually, I probably overplayed the suspenseful nature of the solution. If you examine the webHttpBinding section below, you see the attribute "allowCookies". By default, this is false, meaning cookies are viewed as unsupported by the connecting client.

However, in debug mode in Visual Studio, a session cookie (which was all I was interested in) is still generated by the ASP.NET machinery when a WCF service operation is executing. That's what confused me for a while - I could see the cookie when inspecting the HttpResponse object, but the client never received it.

<bindings>
            <webHttpBinding>
                <binding name="RESTFulBinding" allowCookies="true" />
            </webHttpBinding>
</bindings>

No comments: