Isguest Returning A True Value After Admin Is Authenticated

Fellow Yii developers,

Any advise on how to trouble shoot this would be greatly appreciated! Is there a way I can see if the session is being destroyed? I haven’t touched the login or auth code for the application running live for some time.

I’ve been having a problem with isGuest returning a true value after admin is authenticated. The code I have worked fine on my development machine, but on the server, right after I authenticate, isGuest returns 0, but as soon as I redirect to a controller, it is 1 again**. The result is I am back at the login screen as the controller action requires an authenticated user. I am developing the application (in fact it’s now happening to two of them). But I haven’t worked in the auth or login areas for sometime. One other note, it had worked before in one app, and other (non-developing) applications are still working on the server.

I have looked in the application log (with trace on), and error log, but nothing there. It happens on chrome and IE.

** if I echo after the model->login the isGuest it is 0, but right after the $this->redirect, it is back to 1.

  if(isset($_POST['LoginForm']))  {



     // validate user input and redirect to the previous page if valid

     if($model->validate() && $model->login())



this is weird, clear the browser cache and try if that makes any difference

Thank you!! I have done this before. I will try it again. But it happens on both IE and Chrome.

Also, I have other apps on the server still work fine.

Yes the problem is still there. Do you know anyway I can determine if the session is being broken? There are not errors in the application log nor the site error log.

update: I put everything back to the original (gii generated) loginform, siteController, and login view, but I still have the issue.

Could this be a framework issue? Should I set up debug stuff in $this->render?

solved!! I finally determined that the session was being killed. It was because my server (NetFirms) had upgraded PHP and they turned of sessions by default. Now I figured it wasn’t netfirms because one of my apps still worked up there.

On another note, I need to see our support get better for Yii developers. I will start with me helping others!