I have made a website and put inside it a flash game.
For people to play the game they have to log into the website.
Logging to the website will create a session. I want for the flash game to get the session id ,
so I have created a function that gets the session id. It works only in Internet Explorer and
when I tried it in Chrome, it didn’t retrieve the session id.
So any help?
I have written a php file that will be used by the as3 to get the session id, the php code is this:
<?php
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__) );
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
require('libraries/joomla/factory.php');
class session
{
public function getId()
{
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$user =& JFactory::getUser();
$user_id = $user->get('id');
//echo($user_id);
return $user_id;
}
}
?>
When i tried the flash in IE, the flash got the correct session id, but in Chrome it didn’t.
You could try passing on the session identifier stored in a cookie to the embedded Flash, and then passing it on with Flash as a parameter to the server to identify and initialise the session.