Yii User Session

Hi,

I have a problem with user login in Yii. In our site there are 2 types of users: Admin & User. We have created separate sessions for both of them in config. The problem is that when one of them logs out, the other one also logs out.

The below functions are used for logging out:

Yii::app()->frontUser->logout(); - for user

Yii::app()->User->logout(); - for admin

But in the same browser, if one user is logged out the other one is also logged out. Is there any way to prevent this?

Thanks

I believe once you log in the second account, the other session is gone. I think with session variables there is only one active per browser.

I just ran into an issue with NetFirms. So if you’re running on them, I can tell you about that horror story, otherwise I won’t bore you.

try this http://www.yiiframework.com/doc/api/1.1/CWebUser , where you can manage all other parameters

i am already using this.

At last I have found a solution.

Just add an argument "false" to logout.

Yii::app()->User->logout(false);

Yii::app()->frontUser->logout(false);

So only that user will be logged out.

Thanks