开发者

Transfer PHP session to flash

开发者 https://www.devze.com 2023-01-11 18:51 出处:网络
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

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

精彩评论

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