Isguest() , Cookie , Subdomain.

Hi devs,

I have a problem which is similar to this one =>

I have a domain which doesn’t uses YII frame work and trying to creating a subdomain based on YII. Now in my domain, I determine if the user is logged in based on $Session[‘email’] and $Session[’__id’]. If the session email and id exist, then the user is logged in. I found out that Yii’s Yii::app->user->isGuest checks for the variable ‘__id’ and test if it’s === null.

Problem: When a user login from domain then navigate to the subdomain, Yii::app->user->isGuest returns true, even when $Session[’__id’] = {aString}, and all other session variable is accessible .

Expected output: User should not be guest when going into subdomain.





			// enable cookie-based authentication




		// session configuration

		'session' => array(

            'autoStart' => true,

			'cookieMode' => 'allow',

			'cookieParams' => array(

				'domain' => '',


domain’s login.php. code that runs when user login.

	session_start();//start session here 

.  .  .

			$_SESSION['email'] = $email;

			$_SESSION['__id'] = "logged in";

.  .  .

current output in yii subdomain:

Yii::app()->user->isGuest = 1

Yii::app()->session[‘email’]= {the email }

Yii::app()->session[’__id’]= “logged in”

Thanks for your help. ^^


Any one? :)