开发者

Transfer PHP session to flash

we developed an internet application for company purposes a while back (company and friends, to be precise :]) and now we're trying transfer PHP session to loaded Flash, so flash can identify itself as being loaded with user profile (stored in MySQL, accessed only by PHP so far) when communicating with server (either FMS or Wowza)

Can you advise any safe way to put some code (probably not credentials, but maybe some temporary hash stored in db?) from PHP to code that includes flash, so I can later use it in 开发者_如何学Cmy flash application when communicating with DB?

Thank you


PHP default session is based on COOKIES.

That said you just need to pass the session_id() to Flash on load as a flashvar or via webservices and you can then pass that string back to the server when communicating via Flash.


One way to do it is to just share the current/logged-in user info (basically, username and id) via FlashVars variables. Then related user functionality will be conditioned inside flash based on those variables.

This makes things simpler when it comes to controlling user actions (sign-in / out, profile links...) and at the same time not exposing any (harmful) data to Flash.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜