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:
Zander Baldwin
2013-05-21 14:58:50 +01:00
parent c5eabde5b3
commit 69297ecb71
2 changed files with 2 additions and 0 deletions

View File

@@ -126,6 +126,7 @@ class CDbHttpSession extends CHttpSession
$db->createCommand()->insert($this->sessionTableName, array(
'id'=>$newID,
'expire'=>time()+$this->getTimeout(),
'data'=>'',
));
}
}