How do I do sessions with a Flash client?

前端 未结 2 1071
一生所求
一生所求 2021-01-28 11:34

Since the Flash Player (or, more exactly, the URLLoader class) will not let you read HTTP response headers or cookies set by the server, and if you get hold of a session cookie

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-28 11:53

    How about using the FlashVars parameter? It's designed explicitly to pass simple data into a Flash app, and it's trivial to embed the session token into the tag when the page is generated server-side. PHP-wise, it'd be something like

    blah blah blah
    

    This way there's no session data in the movie's url that could leak via referers, and the data's already "there" so the app doesn't have to reach out and talk to the browser. And if someone's sniffing the source HTML page to get the data, they could have gotten the same information from the HTTP headers anyways.

    There's more details here in the Adobe docs.

提交回复
热议问题