如何从 AMF 使用的 cookie 空间检索 cookie?
我有一个 Flex 应用程序,它使用 AMF 与 Spring Java 后端对话。如何获取服务器设置并由 AMF 发回的 cookie 值?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,AMF 请求期间设置的 cookie 与浏览器发出的正常 Web 请求没有区别。因此,您可以使用一点 JavaScript 和ExternalInterface 来访问这些cookie。
您可以在 stackoverflow 上找到有关如何执行此操作的代码:
编辑:回答你的第二个问题...AMF 不是传输协议。它只是一个在 HTTP 或 HTTPS 等传输协议之上传输数据的二进制协议。如果您查看 AMF0 和 < a href="http://opensource.adobe.com/wiki/download/attachments/1114283/amf3_spec_05_05_08.pdf" rel="nofollow noreferrer">AMF3 您不会发现任何有关 cookie 的提及。
因此,没有 AMF 不使用 cookie(它甚至不知道 cookie),但底层协议(HTTP、HTTPS)可以使用它们(例如交换会话 ID)。如果您想了解有关 HTTP Cookie 的更多信息,可以查看维基百科。
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.