Accessing session data outside Joomla

前端 未结 15 1502
小鲜肉
小鲜肉 2020-12-08 03:36

I am trying to run an application outside Joomla (not as a plugin) and I would like to access the logged in user\'s information (userid). I am wondering how should I go abou

15条回答
  •  猫巷女王i
    2020-12-08 04:04

    It is very possible that like Wordpress, Joomla doesn't use any 'session' data, but rather pulls data directly from the database. In which case you would need to use Joomla's native functions.

    But that is just from my experience with Wordpress.

    Updated

    I guess I was wrong.
    Supposidly this is the api class for accessing Joomla Session variables:

    // Returns a reference to the global JSession object, only creating it if it doesn't already exist $session = &JFactory::getSession();

    // Get a value from a session var $value = $session->get('var_name', null);

    // Put a value in a session var $session->set('var_name', $value);

提交回复
热议问题