简体   繁体   English

将PHP会话传输到Flash

[英]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) 我们不久前出于公司目的开发了一个互联网应用程序(准确地说是公司和朋友:),现在我们正尝试将PHP会话转移到已加载的Flash,因此Flash可以将自己标识为正在加载用户配置文件(存储在MySQL中)与服务器(FMS或Wowza)进行通信时,到目前为止,仅可通过PHP访问)

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? 您能否建议任何安全的方法将PHP中的某些代码(可能不是凭据,而可能是一些存储在db中的临时哈希?)放到包含Flash的代码中,以便以后与DB通信时可以在我的Flash应用程序中使用它?

Thank you 谢谢

PHP default session is based on COOKIES. PHP默认会话基于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. 也就是说,您只需要在加载时以flashvar或通过webservicessession_id()传递给Flash,然后在通过Flash进行通信时就可以将该字符串传递回服务器。

One way to do it is to just share the current/logged-in user info (basically, username and id) via FlashVars variables. 一种方法是仅通过FlashVars变量共享当前/已登录的用户信息(基本上是用户名和ID)。 Then related user functionality will be conditioned inside flash based on those variables. 然后,将基于这些变量在Flash内部对相关的用户功能进行条件设置。

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. 这样一来,在控制用户操作(登录/注销,配置文件链接...)以及同时不向Flash公开任何(有害)数据时,事情就变得更加简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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