Yii Framework Forum: Isguest Returning A True Value After Admin Is Authenticated - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Isguest Returning A True Value After Admin Is Authenticated Rate Topic: -----

#1 User is offline   haymps 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 11-June 12
  • Location:Wake Forest

Posted 04 May 2013 - 11:47 AM

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 www.chasemylead.com, 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']))  {
			\
     $model->attributes=$_POST['LoginForm'];
     // validate user input and redirect to the previous page if valid
     if($model->validate() && $model->login())
	  $this->redirect(Yii::app()->user->returnUrl);		
  }

0

#2 User is offline   alirz23 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 716
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 04 May 2013 - 12:01 PM

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

#3 User is offline   haymps 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 11-June 12
  • Location:Wake Forest

Posted 04 May 2013 - 12:14 PM

View Postalirz23, on 04 May 2013 - 12:01 PM, said:

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.
0

#4 User is offline   haymps 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 11-June 12
  • Location:Wake Forest

Posted 06 May 2013 - 08:34 AM

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?
0

#5 User is offline   haymps 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 11-June 12
  • Location:Wake Forest

Posted 06 May 2013 - 12:50 PM

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!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users