Session Fatal Error in some CLI Scripts

From Joomla! Documentation

Other languages:
English • ‎Nederlands • ‎español • ‎français

Some CLI scripts started failing in Joomla 3.5.0 and higher

Errors reported[edit]

Fatal error: Call to a member function get() on null in /libraries/joomla/session/handler/joomla.php on line 70

Versions affected[edit]

General Information

This pertains only to Joomla! version(s): 3.5.0 and higher

What is the cause[edit]

A mass refactoring of the session library in Joomla 3.5.0 for future stability broke some old CLI scripts

How to fix[edit]

Ensure that you call the session initialise method with:


ensuring that the first parameter is a JInput object (which should be retrievable from the application or you can create a new one). For more information please read the method documentation at https://github.com/joomla/joomla-cms/blob/3.5.0/libraries/joomla/session/session.php#L464