The only way to achieve this is to submit the session id as a POST variable from the flash movie using flashvars to bring the session id into the flash movie.
<param name="FlashVars" value="sessionid=7r2t5u793fil9or6ka95cas1q2" />
We resume the session using the same id when flash makes a request of it's own. So in the PHP code for the request page we resume as follows:
session_id($_POST["sessionid"]);
if ( session_start() == TRUE )
However, a subsequent call generates the following error:
ErrorException [ 8 ]: A session had already been started - ignoring session_start() ~ SYSPATH/classes/kohana/session/native.php [ 43 ]
It might seem as though the session variables are being clobbered as the error is caused by reading unset session variables.
You can try properly destroying the session at the end of your request:
session_destroy();
You can also try ensuring the correct cookie is used:
session_name("session");
To check on your session variables use print_r which will type out the contents of the session array.
print_r($_SESSION);
Checking out cookies in your browser you might see a new cookie appear named PHPSESSID the first time flash makes a request using the session.
This PHPSESSID cookie named is automatically created by a simple session_start call with no frills.
To disable the automatic cookie PHPSESSID and get rid of those errors you can disable the unused PHPSESSID variable using the following two statements before your controller's session instantiation:
ini_set("session.use_cookies", "off");
ini_set("session.use_trans_sid", "off");