I am using ( Joomla! 3.9.11)

define('_JEXEC', 1);    

define('JPATH_BASE', realpath(dirname(__FILE__) . '/..'));
require_once JPATH_BASE . '/includes/defines.php';
require_once JPATH_BASE . '/includes/framework.php';

$application   = JFactory::getApplication('site');


$credentials                = array();
$credentials['username']    = 'user1';
$credentials['password']    = '1234';


$user = JFactory::getUser();


My $user variable is empty and I don't know what I am doing wrong.

New contributor
Anugool Sridum is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Anugool Sridum is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.