I'm building a simple Joomla 4 component, and I need to use a json view for some ajax requests. Just starting the testing process, and ran into an odd seemingly unrelated error message. I don't get this in HTML views, and the session storage is set to database.

<br />
<b>Warning</b>:  session_write_close(): Failed to write session data using user defined save handler. (session.save_path: \Users\username\OneDrive\Documents\Development\xampp\tmp) in <b>C:\Users\username\OneDrive\Documents\Development\xampp\htdocs\joomla\libraries\vendor\joomla\session\src\Storage\NativeStorage.php</b> on line <b>114</b><br />




namespace Joomla\Component\Testcomponent\Site\View\Json;

use Joomla\CMS\MVC\View\JsonView as BaseJsonView;

class JsonView extends BaseJsonView
    public $json;
    public function display($tpl = null)
        $array = [
            'key1' => 'value1',
            'key2' => 'value2',
            'key3' => 'value3',
            'key4' => 'value4'
        $this->json = json_encode($array);


<?= $this->json; ?>
  • I don't have a solution for you, however yesterday I was working with a Fetch in JS passing data to a Joomla 4 component and started receiving the same message. I found reloading the page was the only cure. In my case I am passing JSON but not using the &Format=JSON. I kind of agree with your suggestion that it is probably unrelated or at least not directly.
    – Irata
    Commented Dec 1, 2022 at 2:07
  • Thanks @Irata, I tried loading the URL in an incognito browser, and the page is simply blank instead of the error display. Starting to wonder if this is a bug of some sort, but I'm not sure how to track it down.
    – James
    Commented Dec 1, 2022 at 5:38
  • 1
    If you have debug enabled, it's a bug and you should report it to developers.
    – Sharky
    Commented Dec 1, 2022 at 7:24

1 Answer 1


Posted this to the Joomla Issue Tracker. https://issues.joomla.org/tracker/joomla-cms/39341

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.