0

One project I'm working on right now in AIR uses custom headers requires passing two cookies, basically same name, different values.

something like:

urlRequest.requestHeaders.push(new URLRequestHeader("Cookie", cookie1));
urlRequest.requestHeaders.push(new URLRequestHeader("Cookie", cookie2));

Apparently AS3 doesn't like that and Charles shows only last cookie is being sent to the server, but not both. I did some search and seems like this is allowed(and the API specifically shows it needs two cookies).

So my question is how can I pass two cookies to the custom header using AS3 URLRequest, or can I even do that with URLRequest?

THANKS A BUNCH!!!

J. Holmes
  • 18,466
  • 5
  • 47
  • 52
  • AFAIK you can pass multiple cookies with the same name, but only one will be accepted, see: http://stackoverflow.com/questions/4056306/how-to-handle-multiple-cookies-with-the-same-name Are you sure the API docs aren't just showing subsequent async calls in sequence? – Creynders Feb 07 '12 at 07:59

1 Answers1

0

Could it be that you need to send the cookies in the same header, i.e.

urlRequest.requestHeaders.push(new URLRequestHeader("Cookie", cookie1 + "; " + cookie2));

(Long time since I did AS3.)

Jonas N
  • 1,757
  • 2
  • 21
  • 41