How do I retrieve cookies from the cookie space used by AMF?
I have a flex app that uses AMF to talk to a S开发者_如何学运维pring Java backend. How do I get the values of cookies that have been set by the server and are being sent back by AMF?
As far as I know there's no difference between cookies that are set during AMF request and normal web requests from the browser. So you can access those cookies with a little bit of JavaScript and ExternalInterface.
You can find code on how to do that right here on stackoverflow:
- is it possible to value store cookies in Flash or Flex?
- Accessing browser cookies from Flex
EDIT: To answer your second question... AMF is not a transport protocol. It's just a binary protocol to transfer data on top of tranport protocols like HTTP or HTTPS. If you take a look at the specifications of AMF0 and AMF3 you won't find any mention of cookies.
So, no AMF doesn't use cookies (it doesn't even know about cookies), but the underlying protocols (HTTP, HTTPS) can use them (for example to exchange session IDs). You can take a look at Wikipedia if you want to know more about HTTP Cookies.
精彩评论