Need help with a session script for codeigniter 4

Job ID: 34243162

Budget: $10 – $30 USD

Hello, im porting a core PHP project to Codeigniter 4, but i got a problem, since i need to keep the session open as the page its open i was running two scripts in core PHP
1.- refresh.js -> this script loads with the page and evety X seconds call to a php file named reload session
2.- reload session its quite easy script only runs:

<?php
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
?>

But in Codeigniter i cant use it so i need someone who can modify the php file to make it to run with Codeigniter syntax to keep the session open as the web browser its watching the webpage
Related categories: PHP JavaScript Codeigniter MySQL jQuery / Prototype