How to get current Joomla user with external PHP script

后端 未结 2 1653
天涯浪人
天涯浪人 2020-12-18 07:52

I have a couple PHP scripts used for AJAX queries, but I want them to be able to operate under the umbrella of Joomla\'s authentication system. Is the following safe? Are

2条回答
  •  醉酒成梦
    2020-12-18 08:22

    sure does work , you need to get session data for users

    jimport( 'joomla.session.session' );
    $session                =& JFactory::getSession();
    

    print the session to see what comes out

提交回复
热议问题