I have just noticed that methods setUserState() and getUserState() from JApplication are marked as deprecated.

But what are the replacements for these two methods ?

Thanks by advance

1 Answer 1


They are not deprecated, it's Joomla's documentation that is not perfect.

If you see https://api.joomla.org/cms-3/classes/JFactory.html#method_getApplication

You can notice that it returns JApplicationCms and on this object it is not deprecated. You will also notice that it says to look at \JApplication for more information, but this object is deprecated. Just call the right object.

$app = JFactory::getApplication(); $app->getUserState();

Next time you better click on the reference of the returned object and not the link it says to see for more details :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.