Session problem, can't increment value.

I always get this error message.

"Indirect modification of overloaded element of CDbHttpSession has no effect" when trying to increment my session for login attempts.




if (!isset(Yii::app()->session['admin_login_attempt'])) {

   Yii::app()->session['admin_login_attempt'] = 1;

} else {

   Yii::app()->session['admin_login_attempt']++;

}



I believe which the right way would be:

Yii::app()->session[‘admin_login_attempt’] += 1;