服务端:
//cookie的读取
var requestProperties = OperationContext.Current.IncomingMessageProperties;
var hrp = requestProperties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
var cookie = hrp.Headers[System.Net.HttpRequestHeader.Cookie];
//cookie的写入
var responseProperties = OperationContext.Current.OutgoingMessageProperties;
var httpResponseProperties = new HttpResponseMessageProperty();
httpResponseProperties.Headers.Add(HttpResponseHeader.SetCookie, "name=hlr");
responseProperties.Add(HttpResponseMessageProperty.Name, httpResponseProperties);