Search
Other Sourcerer questions
Forum

trying to access $session

INFINI Marketing's Avatar INFINI Marketing
{source}
    <?php
		$session = JFactory::getSession();
    ?>
{/source}

I can get away with just that. but the moment I add
var_dump($session); 
// or
print_r($session);

the page is completely broken. how can i print out the current joomla session?
Peter van Westen's Avatar Peter van Westen ADMIN
That doesn't really have anything to do with Sourcerer itself.
THat's just PHP code.
You are trying to dump the session object. That is a large object with all sorts of nested objects and references.
That overloads the output buffer and breaks the page.

If you are trying to get a specific value from the session, use the get() method on it.
docs.joomla.org/How_to_access_session_va...y_an_external_script
api.joomla.org/cms-5/classes/Joomla-CMS-Session-Session.html
Please post a rating at the Joomla! Extensions Directory
INFINI Marketing's Avatar INFINI Marketing
makes sense, thanks for the idea / links
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription