tags:

views:

50

answers:

1

I have a flex app that uses AMF to talk to a Spring Java backend. How do I get the values of cookies that have been set by the server and are being sent back by AMF?

+1  A: 

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:

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.

Gerhard
Does AMF use javascript to get and set these cookie values?
DataSurfer
AFAIK the Flash Player uses the browser for it's HTTP requests and the AMF protocol uses HTTP... So there is no need for the Flash Player to use JavaScript or whatnot to get/set cookies since the browser does this all automatically. I haven't tested it but I'm pretty sure that all Set-Cookie headers in AMF responses are ignored if you disable the support for cookies in your browser.
Gerhard