As the title states, I'm interested in knowing what differences there are (if any) between JFactory::getSession() and $mainframe->getSession()

This question was inspired by Retrieve joomla session from within a module

If possible, I'd also like suggestions on how I could find out this information for myself in the future (please don't say google!)

2 Answers 2


The global variable $mainframe was remove in Joomla 1.6 and therefore will not work from that version onwards.

global $mainframe should be replaced with $mainframe = JFactory::getApplication(); but most people tend to use $app instead.

So you code should be like this:

$app = JFactory::getApplication();

Hope this helps


As for ressources about $mainframe:

(Found using Google)

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.