setState raises fatal error (file rights?)


This code:

  public function actionSome() {


Generates the error:

"Fatal error: Exception thrown without a stack frame in Unknown on line 0"

at one site, but not on another. I think the problem is in some file-rights, I just can’t figure out where…


Do you use a custom/extended session class?



class CDbHttpSessionE extends CDbHttpSession {


	public function writeSession($id,$data) {

		$session = Session::model()->findByPk($id);

		if ($session === null) {

			$session = new Session();

			$session->id = $id;


		$session->data = $data;

		$session->lastActivity = time();

		$session->userId = Yii::app()->user->id;

		$session->expire = time() + $this->getTimeout();



		return true;




But it’s used at both sites.

I don’t remember the exact case, but I think this error happend to me when I tried to access the session (readSession()) within a custom writeSession(). Means Yii::app()->user->id will internally call readSession() of course.

To debug further, can you try removing the access to the user component? Like:

// $session->userId = Yii::app()->user->id;


$session->userId = 123;