开发者

Retrieve Joomla's Session in external PHP [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicat开发者_StackOverflow中文版e:

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();


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜