我使用DbSession在数据库中存储会话。 我尝试登录时,有时会遇到此异常。
也许有人以某种方式处理这个问题,或者我做错了什么?
Integrity constraint violation – yii\db\IntegrityException
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'
The SQL being executed was: UPDATE `session` SET `id`=0 WHERE `id`='3u5r7gq6pqh8s0gjrusfqpmni7'
Error Info: Array
(
[0] => 23000
[1] => 1062
[2] => Duplicate entry '0' for key 'PRIMARY'
)
↵
Caused by: PDOException
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'
in /var/www/develop/vendor/yiisoft/yii2/db/Command.php at line 844