/**
  * Overriding Yii's implementation to make sure that session has been started before calling.
  *
  * @param string $key
  * @param mixed  $value
  * @param null   $defaultValue
  *
  * @return null
  */
 public function setState($key, $value, $defaultValue = null)
 {
     // Ensure session is open first.
     craft()->session->open();
     parent::setState($key, $value, $defaultValue);
 }
 /**
  * {@inheritDoc}
  * @see CWebUser::setState()
  */
 public function setState($key, $value, $defaultValue = null)
 {
     return parent::setState($key, $value, $defaultValue);
 }