简体   繁体   中英

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 my 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM