我正在尝试在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);
我试图解决的问题是,我无法通过OpenAm进行经过身份验证的Web服务请求而不使用cookie,我无法弄清楚如何将Cookie放在Flex文件上传请求中(实际上这在IE中有效) ,但在Firefox和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)。