Unable to Logout if login with "Remember Me" checked

When I don’t check “remember me” on the login form, I can logout without any problems. But when I check it, I just can’t logout() it. Everytime I hit logout, which calling


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

It just keep logged in. It still have the username, the Yii::app()->user still contain the login data.

I tried to delete the login cookie manually, but somehow it can’t be deleted.


unset(Yii::app()->request->cookies[$this->getStateKeyPrefix()]);

Can anybody explain to me, what possibly happened on my app?

sorry have to bump~

any clue?

anybody can give me a little clue please?

Just to make sure: does your application perform a redirect after calling Yii:app()->user->logout() ?

Hello phtamas,

I’ve checked it. And yes it does…

At last, I’ve found the solution…

Maybe if others meet the similar problem with me, can take a look…

After do some debugging, I’ve found out that the problem is the cookie doesn’t deleted when logout()

the normal code is supposed to remove. Later I found that I’ve extended the CHttpRequest and CCookieCollection

And I am not extend it correctly causing its remove cookie function not functioning properly…

After fixing the remove code, now it can be logged out…

Just to clarify for me: You extended CHttpRequest and CCookieCollection and the problem was in the extended versions? Not a criticism, we ALL miss stuff, just for clearification.