yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

SessionHistory don't work

Open scorpsan opened this issue 2 years ago • 6 comments

What steps will reproduce the problem?

I have override classes 'classMap' => [ 'User' => \common\models\User::class, 'Profile' => \common\models\Profile::class, 'RegistrationForm' => \common\forms\RegistrationForm::class, 'LoginForm' => \common\forms\LoginForm::class, 'Token' => \common\models\Token::class, 'MailService' => \common\components\user\Service\MailService::class, ], 'controllerMap' => [ 'registration' => 'frontend\controllers\user\RegistrationController', 'security' => 'frontend\controllers\user\SecurityController', 'profile' => 'frontend\controllers\user\ProfileController', 'settings' => 'frontend\controllers\user\SettingsController', 'admin' => 'frontend\controllers\user\AdminController', ],

SessionHistory settings configure like in docs But on the page SessionHistory empty

May be need some changes in the override actions or functions. where module save data about session in to the database?

scorpsan avatar Dec 29 '22 07:12 scorpsan

Have you checked app.log or webserver's error log?

maxxer avatar Dec 29 '22 08:12 maxxer

No errors. If there were errors, I would correct everything. Perhaps some new line of code is missing in my redefined actions At what point is the session database written to?

scorpsan avatar Dec 29 '22 08:12 scorpsan

The session class is loaded into the bootstrapping phase.

Try with XDebug to understand why it's not writing data to db.

maxxer avatar Dec 29 '22 08:12 maxxer

I have the same error, I configured it exactly as instructed but the database has no records written

cuongbn avatar Oct 28 '23 08:10 cuongbn

same issue, in log only deleting old session and didnt create new session history entity, any suggestion?

krdma22 avatar Nov 20 '23 23:11 krdma22

i found fix, in Da\User\Service\SessionHistory\SessionHistoryDecorator::class fix function public function getUseCustomStorage() { return $this->session->getUseCustomStorage(); } To public function getUseCustomStorage() { return true; } Hope to receive everyone's comments. I think this function still has some error.

cuongbn avatar Feb 28 '24 02:02 cuongbn