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,
],