Good day everyone,

I am having problems in retrieving sessions, i'm on a page that loads PHP scripts using jquery $.get, however, everything worked fine when testing on online server, but once i tried to embed the whole thing into joomla, it's doesn't work anymore, this is how i tried to create / retrieve sessions

Code:
define( '_JEXEC', 1 );
define( 'JPATH_BASE', 'Link to somewhere' );
define( 'DS', DIRECTORY_SEPARATOR );
 
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();

$session =& JFactory::getSession();

$name = "John";
$session->set('name',$name);
when i load the next php script and i calls for this session that way:

Code:
define( '_JEXEC', 1 );
define( 'JPATH_BASE', 'Link to somewhere' );
define( 'DS', DIRECTORY_SEPARATOR );
 
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();

$session =& JFactory::getSession();

$test = $session->get('name');
echo $test;
but i get empty !

Please i would apreciate any help about this one