我有一个asp.net应用程序和webservices(asmx),它们驻留在同一个应用程序中,但不在aspx文件的同一个文件夹中.我还有一个使用webservices的winform应用程序.我用[WebMethod(EnableSession = true)]标记了webservice方法,但是我无法共享webservices中应用程序上的相同会话值. winform应用程序可以从应用程序访问sessionID,我使用以下代码
Uri uri = new Uri(ServerServiceUrl); _cookieContainer = new CookieContainer(); _cookieContainer.Add(new Cookie("ASP.NET_SessionId",SessionID,"/",uri.Host));
我的问题是:是否有一些我遗漏或做错的事情,我无法从网络服务访问应用程序sessioin?