Welcome Guest, Not a member yet? Register   Sign In
Upgraded to 4.4.4, error in Session.php
#1

Hi, I just upgraded CI to v 4.4.4 and now i get this error:

Code:
CRITICAL - 2024-08-24 09:26:09 --> ErrorException: Undefined global variable $_SESSION
in SYSTEMPATH/Session/Session.php on line 499.
1 SYSTEMPATH/Session/Session.php(499): CodeIgniter\Debug\Exceptions->errorHandler(2, 'Undefined global variable $_SESSION', '/home/***/system/Session/Session.php', 499)
2 APPPATH/Controllers/BaseController.php(69): CodeIgniter\Session\Session->get('character_id')
3 SYSTEMPATH/CodeIgniter.php(914): App\Controllers\BaseController->initController(Object(CodeIgniter\HTTP\CLIRequest), Object(CodeIgniter\HTTP\Response), Object(CodeIgniter\Log\Logger))
4 SYSTEMPATH/CodeIgniter.php(493): CodeIgniter\CodeIgniter->createController()
5 SYSTEMPATH/CodeIgniter.php(361): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
6 FCPATH/index.php(79): CodeIgniter\CodeIgniter->run()

any help please?
Reply
#2

(This post was last modified: 08-24-2024, 10:48 AM by sunchaser.)

The error is caused by a controller I call from cli. I have read in the docs that session stops immediately when cli is used and inside the BaseController I check if exists session(‘character_id’).

How can I solve this, can I check inside the base controller if a call is from cli?

Ok I think I can use: if ($this->input->is_cli_request()) {
Reply
#3

See https://www.codeigniter.com/user_guide/g...tml#is_cli
Reply




Theme © iAndrew 2016 - Forum software by © MyBB