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);
}