首页 > 代码库 > WCF启用Session

WCF启用Session

1

服务类添加ASPNETSESSION兼容标记

[System.ServiceModel.Activation.AspNetCompatibilityRequirements(RequirementsMode = System.ServiceModel.Activation.AspNetCompatibilityRequirementsMode.Required)]

 

2 web.config 

 <serviceHostingEnvironment aspNetCompatibilityEnabled="true"></serviceHostingEnvironment>

 

3 客户端绑定允许 cookie

 

  <binding name="CookieAllowableBinding" allowCookies="true"/>

 

参考资料 http://www.cnblogs.com/artech/archive/2009/06/25/1511165.html

 

WCF启用Session