0

Possible Duplicate:
Accessing session data outside Joomla

I tried to use the below script to retrieve Joomla's Session, but it's not working. Can anyone help me...

define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(dirname(__FILE__)));
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');
$session     = &JFactory::getSession();
Community
  • 1
  • 1
Prasad007
  • 103
  • 3
  • 7

1 Answers1

0

This is what i use :

    //Joomla Stuff
    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' );

    $mainframe =& JFactory::getApplication('site');

    /**
    * INITIALISE THE APPLICATION
    *
    * NOTE :
    */
    // set the language
    $mainframe->initialise();

    JPluginHelper::importPlugin('system');

    // trigger the onAfterInitialise events
    JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
    $mainframe->triggerEvent('onAfterInitialise');
    // End Joomla Stuff
Tarek
  • 3,810
  • 3
  • 36
  • 62