I'm trying to get session variables working with Joomla using their session code since php's sessions don't work. I am running into a problem trying to access session variables within the joomla custom code module editor though. When I try to access the session variable using the code:
define( '_JEXEC', 1 );
define('JPATH_BASE', "../");
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' );
$session = JFactory::getSession();
$print $session->get('status');
I get nothing. If I take that same code and paste it into its own php file I can get the status variable fine. When I look at the plain text version of Joomla preview I see this:
get('status'); ?>
Doing some testing I think it's related to the '->' operand. Has anyone encountered this before and know how to fix it? I'm running Direct PHP and can print out strings and other variables inside of the module fwiw.