Auto logout after login

I have a problem. I am on windows and I use vscode with SFTP to transfer my project to a server, and I have a database. My problem is that after I log in, everything is validated, it logs out the user automatically.
Or, I don’t know, I am not logged it. It redirects me in index.php with the button for login, and it doesn’t show me the username in the navbar. Please help.
web.php

    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'imp0s181l',
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'rules' => [
                'register' => 'site/register',
                'login' => 'site/login',
            ],
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'user' => [
            'identityClass' => 'app\models\User',
            'enableAutoLogin' => false,
            'authTimeout' => 0,
            'enableSession' => true,
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'mailer' => [
            'class' => \yii\symfonymailer\Mailer::class,
            'viewPath' => '@app/mail',
            // send all mails to a file by default.
            'useFileTransport' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'session' => [
            'class' => 'yii\web\Session',
            'cookieParams' => [
                'secure' => false,
            ],
        ],
        'db' => $db,
        
    ],

Please provide relevant codes to login part in addition to config

https://github.com/FlaviusAga08/yii2.git The relevant files

În joi, 21 dec. 2023 la 16:39, Stefano Mtangoo via Yii Forum <forum@yiiframework.com> a scris:

That’s a bunch of unstructured code.

My first suspicious code would be mixing default list based and ActiveRecord code. Something like

public static function findIdentity($id)
{
    return isset(self::$_users[$id]) ? new static(self::$_users[$id]) : null;
}