在 Flex URLRequest 中设置 cookie
我正在尝试在 Flex 中设置 cookie,但似乎不起作用。我做错了什么吗?这可能吗?看来这件事应该很简单。
var fileRef:FileReference;
// fileRef is configured
var cookieString:String = "my cookies";
var cookieHeader:URLRequestHeader= new URLRequestHeader("Cookie", cookieString);
var url:String = 'my url';
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;
request.requestHeaders.push(cookieHeader);
fileRef.upload(request);
我试图解决的问题是,我无法在不使用 cookie 的情况下通过 OpenAm 发出经过身份验证的 Web 服务请求,并且我无法弄清楚如何将 cookie 放置在 Flex 文件上传请求中(实际上这在 IE 中有效,但在 Firefox 和 Chrome 中损坏 - 我读到这是因为IE 在同一个浏览器线程中上传文件,而其他一些浏览器则生成一个新线程,并且 cookie 信息不会被传递)。
I'm trying to set a cookie in a Flex, but it doesn't seem to work. Am I doing something wrong? Is this possible? It seems like this should be simple.
var fileRef:FileReference;
// fileRef is configured
var cookieString:String = "my cookies";
var cookieHeader:URLRequestHeader= new URLRequestHeader("Cookie", cookieString);
var url:String = 'my url';
var request:URLRequest = new URLRequest(url);
request.method = URLRequestMethod.POST;
request.requestHeaders.push(cookieHeader);
fileRef.upload(request);
The problem I'm trying to solve is, I cannot make a authenticated web service request through OpenAm without using cookies, and I cannot figure out how to place the cookies in the Flex file upload request (well actually this works in IE, but is broken in Firefox and Chrome - I read that this is because IE uploads the file in the same browser thread while some other browsers spawn a new thread, and the cookie information does not get passed along).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论