0
构建与使用JSESSIONID cookie的站点交互的ASP.Net应用程序。 我给出的规范说要返回每个请求的Cookie。 我将cookie从登录响应的头部提取出来,但是当我尝试在以下请求中使用它时,出现'PlatformNotSupported错误' 显然这是由于安全性的“改进”。 我已经看到博客讨论编写代理服务器以及创建从IHttpModule派生的类。 混淆我一号 是否有一个简单的推荐方式编码HttpWebRequest,以便我可以传输Cookie?Asp.Net HTTPWebRequest返回JSESSIONID Cookie
偶尔用户的StackOverflow,试图发表评论,失败,所以编辑后。 代码是: string cookie =“JSESSIONID =”+ Session [“SessionId”]。ToString();
if(Request.Cookies["JSESSIONID"]==null)
{
//Request.Headers.Add("Cookie",cookie);//PlatformNotSupportedError
HttpCookie cook = new HttpCookie("JSESSIONID", Session["SessionId"].ToString());
Request.Cookies.Add(cook);
} //The prev login response had the cookie in the header not in the cookies collection so I was trying to send back the same way. ASP.net app at this stage. Will be service after get it going. Thx Bob
Bob您是否有可以发布的代码示例?你试图通过一个网络服务偶然做到这一点..? – MethodMan 2012-08-16 22:05:06