mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-21 07:26:53 +01:00
Prevent SQL Exception When Regenerating Session ID
RE: yiisoft/yii#2491 Added a value (empty string) for the `data` column when inserting a new row into the session table; the `data` column does not allow null values nor does it have a default value assigned so the CDbCommand::insert() method was throwing an exception when the SQL command failed.
This commit is contained in:
@@ -126,6 +126,7 @@ class CDbHttpSession extends CHttpSession
|
||||
$db->createCommand()->insert($this->sessionTableName, array(
|
||||
'id'=>$newID,
|
||||
'expire'=>time()+$this->getTimeout(),
|
||||
'data'=>'',
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user