codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.4k stars 1.9k forks source link

Bug: [Session] Unknown column 'data' in 'field list' with Config FileHandler driver #7411

Closed ddevsr closed 1 year ago

ddevsr commented 1 year ago

PHP Version

8.1

CodeIgniter4 Version

4.3.3

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

No response

What happened?

I have session configuration default by CI using Filehandler and set property session in BaseController like $this->session = Services::session(); for getFlashData if login failed. In v4.2.12 its OK. And now sometimes no error sometimes error when refreshed.

INFO - 2023-04-05 08:40:33 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
ERROR - 2023-04-05 08:40:35 --> mysqli_sql_exception: Unknown column 'data' in 'field list' in D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Database\MySQLi\Connection.php:295
Stack trace:
#0 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Database\MySQLi\Connection.php(295): mysqli->query('SELECT `data`\nF...', 0)
#1 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Database\BaseConnection.php(691): CodeIgniter\Database\MySQLi\Connection->execute('SELECT `data`\nF...')
#2 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Database\BaseConnection.php(605): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT `data`\nF...')
#3 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Database\BaseBuilder.php(1616): CodeIgniter\Database\BaseConnection->query('SELECT `data`\nF...', Array, false)
#4 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Session\Handlers\DatabaseHandler.php(144): CodeIgniter\Database\BaseBuilder->get()
#5 [internal function]: CodeIgniter\Session\Handlers\DatabaseHandler->read('jgts8f1jmrvvgds...')
#6 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Session\Session.php(928): session_start()
#7 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Session\Session.php(250): CodeIgniter\Session\Session->startSession()
#8 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Config\Services.php(674): CodeIgniter\Session\Session->start()
#9 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Config\BaseService.php(252): CodeIgniter\Config\Services::session(Object(Config\App), false)
#10 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Config\BaseService.php(193): CodeIgniter\Config\BaseService::__callStatic('session', Array)
#11 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Config\Services.php(641): CodeIgniter\Config\BaseService::getSharedInstance('session', NULL)
#12 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\Config\BaseService.php(252): CodeIgniter\Config\Services::session()
#13 D:\Project\laragon\www\myproject\app\Controllers\BaseController.php(87): CodeIgniter\Config\BaseService::__callStatic('session', Array)
#14 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\CodeIgniter.php(907): App\Controllers\BaseController->initController(Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), Object(CodeIgniter\Log\Logger))
#15 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\CodeIgniter.php(490): CodeIgniter\CodeIgniter->createController()
#16 D:\Project\laragon\www\myproject\vendor\codeigniter4\framework\system\CodeIgniter.php(368): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#17 D:\Project\laragon\www\myproject\public\index.php(67): CodeIgniter\CodeIgniter->run()
#18 {main}
CRITICAL - 2023-04-05 08:40:35 --> Unknown column 'data' in 'field list'
in SYSTEMPATH\Database\MySQLi\Connection.php on line 295.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(295): mysqli->query('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:jgts8f1jmrvvgdsa7pi3uhuqto06e23r\'
AND `ip_address` = \'127.0.0.1\'', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(691): CodeIgniter\Database\MySQLi\Connection->execute('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:jgts8f1jmrvvgdsa7pi3uhuqto06e23r\'
AND `ip_address` = \'127.0.0.1\'')
 3 SYSTEMPATH\Database\BaseConnection.php(605): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:jgts8f1jmrvvgdsa7pi3uhuqto06e23r\'
AND `ip_address` = \'127.0.0.1\'')
 4 SYSTEMPATH\Database\BaseBuilder.php(1616): CodeIgniter\Database\BaseConnection->query('SELECT `data`
FROM `sm_sessions`
WHERE `id` = :id:
AND `ip_address` = :ip_address:', [...], false)
 5 SYSTEMPATH\Session\Handlers\DatabaseHandler.php(144): CodeIgniter\Database\BaseBuilder->get()
 6 [internal function]: CodeIgniter\Session\Handlers\DatabaseHandler->read('jgts8f1jmrvvgdsa7pi3uhuqto06e23r')
 7 SYSTEMPATH\Session\Session.php(928): session_start()
 8 SYSTEMPATH\Session\Session.php(250): CodeIgniter\Session\Session->startSession()
 9 SYSTEMPATH\Config\Services.php(674): CodeIgniter\Session\Session->start()
10 SYSTEMPATH\Config\BaseService.php(252): CodeIgniter\Config\Services::session(Object(Config\App), false)
11 SYSTEMPATH\Config\BaseService.php(193): CodeIgniter\Config\BaseService::__callStatic('session', [...])
12 SYSTEMPATH\Config\Services.php(641): CodeIgniter\Config\BaseService::getSharedInstance('session', null)
13 SYSTEMPATH\Config\BaseService.php(252): CodeIgniter\Config\Services::session()
14 APPPATH\Controllers\BaseController.php(87): CodeIgniter\Config\BaseService::__callStatic('session', [])
15 SYSTEMPATH\CodeIgniter.php(907): App\Controllers\BaseController->initController(Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), Object(CodeIgniter\Log\Logger))
16 SYSTEMPATH\CodeIgniter.php(490): CodeIgniter\CodeIgniter->createController()
17 SYSTEMPATH\CodeIgniter.php(368): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
18 FCPATH\index.php(67): CodeIgniter\CodeIgniter->run()
INFO - 2023-04-05 08:50:05 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-05 08:50:08 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-05 08:50:12 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.

Steps to Reproduce

Config\App :

    /**
     * --------------------------------------------------------------------------
     * Session Driver
     * --------------------------------------------------------------------------
     *
     * The session storage driver to use:
     * - `CodeIgniter\Session\Handlers\FileHandler`
     * - `CodeIgniter\Session\Handlers\DatabaseHandler`
     * - `CodeIgniter\Session\Handlers\MemcachedHandler`
     * - `CodeIgniter\Session\Handlers\RedisHandler`
     *
     * @deprecated use Config\Session::$driver instead.
     */
    public string $sessionDriver = FileHandler::class;

    /**
     * --------------------------------------------------------------------------
     * Session Cookie Name
     * --------------------------------------------------------------------------
     *
     * The session cookie name, must contain only [0-9a-z_-] characters
     *
     * @deprecated use Config\Session::$cookieName  instead.
     */
    public string $sessionCookieName = 'ci_session';

    /**
     * --------------------------------------------------------------------------
     * Session Expiration
     * --------------------------------------------------------------------------
     *
     * The number of SECONDS you want the session to last.
     * Setting to 0 (zero) means expire when the browser is closed.
     *
     * @deprecated use Config\Session::$expiration instead.
     */
    public int $sessionExpiration = 86400;

    /**
     * --------------------------------------------------------------------------
     * Session Save Path
     * --------------------------------------------------------------------------
     *
     * The location to save sessions to and is driver dependent.
     *
     * For the 'files' driver, it's a path to a writable directory.
     * WARNING: Only absolute paths are supported!
     *
     * For the 'database' driver, it's a table name.
     * Please read up the manual for the format with other session drivers.
     *
     * IMPORTANT: You are REQUIRED to set a valid save path!
     *
     * @deprecated use Config\Session::$savePath instead.
     */
    public string $sessionSavePath = WRITEPATH . 'session';

    /**
     * --------------------------------------------------------------------------
     * Session Match IP
     * --------------------------------------------------------------------------
     *
     * Whether to match the user's IP address when reading the session data.
     *
     * WARNING: If you're using the database driver, don't forget to update
     *          your session table's PRIMARY KEY when changing this setting.
     *
     * @deprecated use Config\Session::$matchIP instead.
     */
    public bool $sessionMatchIP = true;

    /**
     * --------------------------------------------------------------------------
     * Session Time to Update
     * --------------------------------------------------------------------------
     *
     * How many seconds between CI regenerating the session ID.
     *
     * @deprecated use Config\Session::$timeToUpdate instead.
     */
    public int $sessionTimeToUpdate = 300;

    /**
     * --------------------------------------------------------------------------
     * Session Regenerate Destroy
     * --------------------------------------------------------------------------
     *
     * Whether to destroy session data associated with the old session ID
     * when auto-regenerating the session ID. When set to FALSE, the data
     * will be later deleted by the garbage collector.
     *
     * @deprecated use Config\Session::$regenerateDestroy instead.
     */
    public bool $sessionRegenerateDestroy = true;

Config\Session :

    /**
     * --------------------------------------------------------------------------
     * Session Driver
     * --------------------------------------------------------------------------
     *
     * The session storage driver to use:
     * - `CodeIgniter\Session\Handlers\FileHandler`
     * - `CodeIgniter\Session\Handlers\DatabaseHandler`
     * - `CodeIgniter\Session\Handlers\MemcachedHandler`
     * - `CodeIgniter\Session\Handlers\RedisHandler`
     *
     * @phpstan-var class-string<BaseHandler>
     */
    public string $driver = FileHandler::class;

    /**
     * --------------------------------------------------------------------------
     * Session Cookie Name
     * --------------------------------------------------------------------------
     *
     * The session cookie name, must contain only [0-9a-z_-] characters
     */
    public string $cookieName = 'ci_session';

    /**
     * --------------------------------------------------------------------------
     * Session Expiration
     * --------------------------------------------------------------------------
     *
     * The number of SECONDS you want the session to last.
     * Setting to 0 (zero) means expire when the browser is closed.
     */
    public int $expiration = 86400;

    /**
     * --------------------------------------------------------------------------
     * Session Save Path
     * --------------------------------------------------------------------------
     *
     * The location to save sessions to and is driver dependent.
     *
     * For the 'files' driver, it's a path to a writable directory.
     * WARNING: Only absolute paths are supported!
     *
     * For the 'database' driver, it's a table name.
     * Please read up the manual for the format with other session drivers.
     *
     * IMPORTANT: You are REQUIRED to set a valid save path!
     */
    public string $savePath = WRITEPATH . 'session';

    /**
     * --------------------------------------------------------------------------
     * Session Match IP
     * --------------------------------------------------------------------------
     *
     * Whether to match the user's IP address when reading the session data.
     *
     * WARNING: If you're using the database driver, don't forget to update
     *          your session table's PRIMARY KEY when changing this setting.
     */
    public bool $matchIP = true;

    /**
     * --------------------------------------------------------------------------
     * Session Time to Update
     * --------------------------------------------------------------------------
     *
     * How many seconds between CI regenerating the session ID.
     */
    public int $timeToUpdate = 300;

    /**
     * --------------------------------------------------------------------------
     * Session Regenerate Destroy
     * --------------------------------------------------------------------------
     *
     * Whether to destroy session data associated with the old session ID
     * when auto-regenerating the session ID. When set to FALSE, the data
     * will be later deleted by the garbage collector.
     */
    public bool $regenerateDestroy = true;

    /**
     * --------------------------------------------------------------------------
     * Session Database Group
     * --------------------------------------------------------------------------
     *
     * DB Group for the database session.
     */
    public ?string $DBGroup = null;

Expected Output

No error

Anything else?

No response

kenjis commented 1 year ago

You are using DatabaseHandler. Check environment variable for $driver.

ddevsr commented 1 year ago

My environment no have variable session config. This show error session sometimes

kenjis commented 1 year ago

Where do the query and the sm_sessions table come from?

mysqli->query('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:jgts8f1jmrvvgdsa7pi3uhuqto06e23r\'
AND `ip_address` = \'127.0.0.1\'', 0)
ddevsr commented 1 year ago

Updated log

INFO - 2023-04-06 14:01:55 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
ERROR - 2023-04-06 14:01:57 --> mysqli_sql_exception: Unknown column 'data' in 'field list' in D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\MySQLi\Connection.php:295
Stack trace:
#0 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\MySQLi\Connection.php(295): mysqli->query('SELECT `data`\nF...', 0)
#1 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\BaseConnection.php(691): CodeIgniter\Database\MySQLi\Connection->execute('SELECT `data`\nF...')
#2 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\BaseConnection.php(605): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT `data`\nF...')
#3 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\BaseBuilder.php(1616): CodeIgniter\Database\BaseConnection->query('SELECT `data`\nF...', Array, false)
#4 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Session\Handlers\DatabaseHandler.php(144): CodeIgniter\Database\BaseBuilder->get()
#5 [internal function]: CodeIgniter\Session\Handlers\DatabaseHandler->read('1e3bnk4mavitqr7...')
#6 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Session\Session.php(928): session_start()
#7 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Session\Session.php(250): CodeIgniter\Session\Session->startSession()
#8 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\Services.php(674): CodeIgniter\Session\Session->start()
#9 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\BaseService.php(252): CodeIgniter\Config\Services::session(Object(Config\App), false)
#10 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\BaseService.php(193): CodeIgniter\Config\BaseService::__callStatic('session', Array)
#11 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\Services.php(641): CodeIgniter\Config\BaseService::getSharedInstance('session', NULL)
#12 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\BaseService.php(252): CodeIgniter\Config\Services::session()
#13 D:\Project\laragon\www\semangkaweb\app\Controllers\BaseController.php(87): CodeIgniter\Config\BaseService::__callStatic('session', Array)
#14 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\CodeIgniter.php(907): App\Controllers\BaseController->initController(Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), Object(CodeIgniter\Log\Logger))
#15 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\CodeIgniter.php(490): CodeIgniter\CodeIgniter->createController()
#16 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\CodeIgniter.php(368): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#17 D:\Project\laragon\www\semangkaweb\public\index.php(67): CodeIgniter\CodeIgniter->run()
#18 {main}
CRITICAL - 2023-04-06 14:01:57 --> Unknown column 'data' in 'field list'
in SYSTEMPATH\Database\MySQLi\Connection.php on line 295.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(295): mysqli->query('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:1e3bnk4mavitqr7st2a5hq17qeu1lni0\'
AND `ip_address` = \'127.0.0.1\'', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(691): CodeIgniter\Database\MySQLi\Connection->execute('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:1e3bnk4mavitqr7st2a5hq17qeu1lni0\'
AND `ip_address` = \'127.0.0.1\'')
 3 SYSTEMPATH\Database\BaseConnection.php(605): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:1e3bnk4mavitqr7st2a5hq17qeu1lni0\'
AND `ip_address` = \'127.0.0.1\'')
 4 SYSTEMPATH\Database\BaseBuilder.php(1616): CodeIgniter\Database\BaseConnection->query('SELECT `data`
FROM `sm_sessions`
WHERE `id` = :id:
AND `ip_address` = :ip_address:', [...], false)
 5 SYSTEMPATH\Session\Handlers\DatabaseHandler.php(144): CodeIgniter\Database\BaseBuilder->get()
 6 [internal function]: CodeIgniter\Session\Handlers\DatabaseHandler->read('1e3bnk4mavitqr7st2a5hq17qeu1lni0')
 7 SYSTEMPATH\Session\Session.php(928): session_start()
 8 SYSTEMPATH\Session\Session.php(250): CodeIgniter\Session\Session->startSession()
 9 SYSTEMPATH\Config\Services.php(674): CodeIgniter\Session\Session->start()
10 SYSTEMPATH\Config\BaseService.php(252): CodeIgniter\Config\Services::session(Object(Config\App), false)
11 SYSTEMPATH\Config\BaseService.php(193): CodeIgniter\Config\BaseService::__callStatic('session', [...])
12 SYSTEMPATH\Config\Services.php(641): CodeIgniter\Config\BaseService::getSharedInstance('session', null)
13 SYSTEMPATH\Config\BaseService.php(252): CodeIgniter\Config\Services::session()
14 APPPATH\Controllers\BaseController.php(87): CodeIgniter\Config\BaseService::__callStatic('session', [])
15 SYSTEMPATH\CodeIgniter.php(907): App\Controllers\BaseController->initController(Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), Object(CodeIgniter\Log\Logger))
16 SYSTEMPATH\CodeIgniter.php(490): CodeIgniter\CodeIgniter->createController()
17 SYSTEMPATH\CodeIgniter.php(368): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
18 FCPATH\index.php(67): CodeIgniter\CodeIgniter->run()
kenjis commented 1 year ago

The Session was initialized using FileHandler at 14:01:55. And two seconds later, the MySQL query was executed. Two seconds is a very long time.

INFO - 2023-04-06 14:01:55 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
ERROR - 2023-04-06 14:01:57 --> mysqli_sql_exception: Unknown column 'data' in 'field list' in D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\MySQLi\Connection.php:295
ddevsr commented 1 year ago

Its manual refresh in browser.

INFO - 2023-04-06 14:01:55 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
ERROR - 2023-04-06 14:01:57 --> mysqli_sql_exception: Unknown column 'data' in 'field list' in D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\MySQLi\Connection.php:295
Stack trace:
#0 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\MySQLi\Connection.php(295): mysqli->query('SELECT `data`\nF...', 0)
#1 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\BaseConnection.php(691): CodeIgniter\Database\MySQLi\Connection->execute('SELECT `data`\nF...')
#2 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\BaseConnection.php(605): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT `data`\nF...')
#3 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Database\BaseBuilder.php(1616): CodeIgniter\Database\BaseConnection->query('SELECT `data`\nF...', Array, false)
#4 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Session\Handlers\DatabaseHandler.php(144): CodeIgniter\Database\BaseBuilder->get()
#5 [internal function]: CodeIgniter\Session\Handlers\DatabaseHandler->read('1e3bnk4mavitqr7...')
#6 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Session\Session.php(928): session_start()
#7 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Session\Session.php(250): CodeIgniter\Session\Session->startSession()
#8 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\Services.php(674): CodeIgniter\Session\Session->start()
#9 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\BaseService.php(252): CodeIgniter\Config\Services::session(Object(Config\App), false)
#10 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\BaseService.php(193): CodeIgniter\Config\BaseService::__callStatic('session', Array)
#11 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\Services.php(641): CodeIgniter\Config\BaseService::getSharedInstance('session', NULL)
#12 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\Config\BaseService.php(252): CodeIgniter\Config\Services::session()
#13 D:\Project\laragon\www\semangkaweb\app\Controllers\BaseController.php(87): CodeIgniter\Config\BaseService::__callStatic('session', Array)
#14 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\CodeIgniter.php(907): App\Controllers\BaseController->initController(Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), Object(CodeIgniter\Log\Logger))
#15 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\CodeIgniter.php(490): CodeIgniter\CodeIgniter->createController()
#16 D:\Project\laragon\www\semangkaweb\vendor\codeigniter4\framework\system\CodeIgniter.php(368): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#17 D:\Project\laragon\www\semangkaweb\public\index.php(67): CodeIgniter\CodeIgniter->run()
#18 {main}
CRITICAL - 2023-04-06 14:01:57 --> Unknown column 'data' in 'field list'
in SYSTEMPATH\Database\MySQLi\Connection.php on line 295.
 1 SYSTEMPATH\Database\MySQLi\Connection.php(295): mysqli->query('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:1e3bnk4mavitqr7st2a5hq17qeu1lni0\'
AND `ip_address` = \'127.0.0.1\'', 0)
 2 SYSTEMPATH\Database\BaseConnection.php(691): CodeIgniter\Database\MySQLi\Connection->execute('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:1e3bnk4mavitqr7st2a5hq17qeu1lni0\'
AND `ip_address` = \'127.0.0.1\'')
 3 SYSTEMPATH\Database\BaseConnection.php(605): CodeIgniter\Database\BaseConnection->simpleQuery('SELECT `data`
FROM `sm_sessions`
WHERE `id` = \'sm_session:1e3bnk4mavitqr7st2a5hq17qeu1lni0\'
AND `ip_address` = \'127.0.0.1\'')
 4 SYSTEMPATH\Database\BaseBuilder.php(1616): CodeIgniter\Database\BaseConnection->query('SELECT `data`
FROM `sm_sessions`
WHERE `id` = :id:
AND `ip_address` = :ip_address:', [...], false)
 5 SYSTEMPATH\Session\Handlers\DatabaseHandler.php(144): CodeIgniter\Database\BaseBuilder->get()
 6 [internal function]: CodeIgniter\Session\Handlers\DatabaseHandler->read('1e3bnk4mavitqr7st2a5hq17qeu1lni0')
 7 SYSTEMPATH\Session\Session.php(928): session_start()
 8 SYSTEMPATH\Session\Session.php(250): CodeIgniter\Session\Session->startSession()
 9 SYSTEMPATH\Config\Services.php(674): CodeIgniter\Session\Session->start()
10 SYSTEMPATH\Config\BaseService.php(252): CodeIgniter\Config\Services::session(Object(Config\App), false)
11 SYSTEMPATH\Config\BaseService.php(193): CodeIgniter\Config\BaseService::__callStatic('session', [...])
12 SYSTEMPATH\Config\Services.php(641): CodeIgniter\Config\BaseService::getSharedInstance('session', null)
13 SYSTEMPATH\Config\BaseService.php(252): CodeIgniter\Config\Services::session()
14 APPPATH\Controllers\BaseController.php(87): CodeIgniter\Config\BaseService::__callStatic('session', [])
15 SYSTEMPATH\CodeIgniter.php(907): App\Controllers\BaseController->initController(Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), Object(CodeIgniter\Log\Logger))
16 SYSTEMPATH\CodeIgniter.php(490): CodeIgniter\CodeIgniter->createController()
17 SYSTEMPATH\CodeIgniter.php(368): CodeIgniter\CodeIgniter->handleRequest(null, Object(Config\Cache), false)
18 FCPATH\index.php(67): CodeIgniter\CodeIgniter->run()
INFO - 2023-04-06 14:05:57 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:06:43 --> CSRF token verified.
INFO - 2023-04-06 14:06:43 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:06:44 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:06:51 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:06:53 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:49:34 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:49:37 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:49:38 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:49:41 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:49:44 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:49:46 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:49:47 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:49:48 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:49:50 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:50:40 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:50:41 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:50:42 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:50:44 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:50:45 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:50:46 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:50:47 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.
INFO - 2023-04-06 14:50:48 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver.

I will close, back after found this.