I\'m having a WCF client which communicates with a WCF service (running AspNetCompabilityMode), and I would like to add a cookie
http://megakemp.wordpress.com/2009/02/06/managing-shared-cookies-in-wcf/
Unlike other manuals provided in other answers, this one contains all the information you need in one place in a well structured manner.
The method described in http://kennyw.com/indigo/153 works on a per-service-call basis. This means you have to make sure all invocations to your WCF service are made after the OperationContextScope object is created and before it is disposed for this to work. Otherwise the cookie will never be added to the request.
If you are looking for a centralized solution to manually add a cookie to all outgoing HTTP requests made to the WCF service have a look at this thread:
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/624fb3f9-222d-4795-9140-fe9ef3934361/
You have to set the allowCookies configuration option for your binding to false. This sounds odd, but it is explained why here:
http://kennyw.com/indigo/211
Once you do that, you have to add the cookies yourself using the method described here:
http://kennyw.com/indigo/153