I'm trying to use CDbHttpSession in Yii to store the session data into a database. However, Yii doesn't seem to store the information, just update the id. Here is a full application log:
03:23:21.016446 trace system.db.CDbCommand
Querying SQL: SELECT *
FROM `YiiSession`
WHERE id=:id. Bound with :id='9m6bmlf12v4r9e7bleusv1rmp7'
in /YIIPATH/protected/models/LoginForm.php (29)
in
/YIIPATH/protected/controllers/SiteController.php
(115)
in /YIIPATH/index.php (13)
03:23:21.016472 profile system.db.CDbCommand.query
begin:system.db.CDbCommand.query(SELECT *
FROM `YiiSession`
WHERE id=:id. Bound with :id='9m6bmlf12v4r9e7bleusv1rmp7')
03:23:21.017136 profile system.db.CDbCommand.query
end:system.db.CDbCommand.query(SELECT *
FROM `YiiSession`
WHERE id=:id. Bound with :id='9m6bmlf12v4r9e7bleusv1rmp7')
03:23:21.017270 trace system.db.CDbCommand
Executing SQL: UPDATE `YiiSession` SET `id`=:id WHERE id=:oldID. Bound with
:oldID='9m6bmlf12v4r9e7bleusv1rmp7', :id='26h85kqrvrecd67kdf4riahca5'
in /YIIPATH/protected/models/LoginForm.php (29)
in
/YIIPATH/protected/controllers/SiteController.php
(115)
in /YIIPATH/index.php (13)
03:23:21.017291 profile system.db.CDbCommand.execute
begin:system.db.CDbCommand.execute(UPDATE `YiiSession` SET `id`=:id WHERE
id=:oldID. Bound with :oldID='9m6bmlf12v4r9e7bleusv1rmp7',
:id='26h85kqrvrecd67kdf4riahca5')
03:23:21.017766 profile system.db.CDbCommand.execute
end:system.db.CDbCommand.execute(UPDATE `YiiSession` SET `id`=:id WHERE
id=:oldID. Bound with :oldID='9m6bmlf12v4r9e7bleusv1rmp7',
:id='26h85kqrvrecd67kdf4riahca5')
Any help would be much appreciated. Thanks!
因此,我注意到,如果您使用数据库进行会话存储,则必须在用户标识下设置持续时间,否则默认为0。以防有人遇到此问题。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.