views:

43

answers:

2

Hello,

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

+1  A: 

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.

Frankie
A: 

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.

Makram Saleh
Yes, but isn't it then too easy to open up source code and try different combinations of id/user?
Adam Kiss