当我做一个webrequest调用服务时,为什么它总是生成一个新的sessionid?Session.SessionId持久性请求到ashx
这是我从sitea.com
WebClient fs = new WebClient();
var data = fs.DownloadData("http://siteb.com/serice.ashx");
var tostring = System.Text.Encoding.ASCII.GetString(data);
return tostring;
致电这是在siteb.com服务代码
[WebMethod(EnableSession = true)]
private string Read(HttpContext context)
{
var value = context.Session.SessionId;
if (value !=null) return value.ToString();
return "false";
}
值始终为每个请求的不同。我该如何坚持下去?
适合我。很好的解决方案! – 2015-10-05 14:00:52