我怎样才能让Flash分享浏览器cookies / session? [英] How can I get Flash to share the browser cookies/session?

查看:160
本文介绍了我怎样才能让Flash分享浏览器cookies / session?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个基于PHP的Web应用程序,并正在集成一个基于Flash的图表引擎。 Flash图表需要为其数据发出AJAX请求。此请求失败,因为它被视为新的用户代理,并且不包含PHP会话Cookie来识别它。所以,它被重定向到登录页面。

我已经读了几个黑客来做这个工作,包括在查询字符串上提供会话ID,但是打开安全漏洞。我怎样才能让Flash和PHP自动分享基于cookie的会话状态并保持安全呢?

解决方案

在IE中, 。在Firefox中,实现这一目的的唯一方法是将会话ID POST到闪存脚本(即PHP处理器)中,并从中恢复会话。

I'm building a PHP-based web app and am integrating a Flash-based charting engine. The Flash chart needs to make a AJAX request for its data. This request fails because it is seen as a new user agent and doesn't contain the PHP session cookie to identify it. So, it gets redirected to the login page.

I've read a few hacks to make this work, including supplying the session ID on the querystring, but that opens up security holes. How can I get Flash and PHP to share cookie-based session state automatically and stay secure?

解决方案

In IE it will work naively. In firefox, the only way to achieve this is to POST the session id into the flash script (the php processor that is), and have it restore the session from that.

这篇关于我怎样才能让Flash分享浏览器cookies / session?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆