1

I'm making a tutoring for students system in Yii 1.1.12 but I'm stuck in user session management.

I'm with other three guys in this. I'm using Rights for role management.

The problem is that two of the other guys are being logged out if a specific sequence of links is followed, but not me (neither the last guy).

The process is this: We have a login form (the default login form Yii gives you, but with db login) Login Form

Then the user is presented in a dashboard where he has a menu and in the main info, theres a link (is equal to one in the left menu) to an action.

Dashboard

If the user clicks on the link (the blue one in the image) in the main part, they go to that action.

Tutor list

Here we have a table with registered tutors (in a db table) with a link (it looks like a button but is CSS, the gray ones under the red ones) to an action for assign students to that tutor.

Suddenly, the system logs out the user asking for username and password again

enter image description here

As you can see in the variables values we have Yii::app->user->isGuest() as true when this happens (before this it is false).

The button links are built like this:

<td>
  <?php echo CHtml::link('Dar de baja', array('desactivar', 'id'=>$academic->id), array('class'=>'btn btn-mini btn-danger')); ?>
  <?php echo CHtml::link('Expediente', array('view', 'id'=>$academic->id), array('class'=>'btn btn-mini')); ?>
</td>

And also the link in the second image is built that way:

<?php echo CHtml::link('Asignación e información de tutores', array('tutor/registered')); ?>

The left menu is a zii.widgets.CMenu and the $menu is built with:

array('label'=>'Asignación e información de tutores', 'url'=>array('/tutor/registered')),

The reason I'm explaining this is because this log out error only happens that way. If the user instead of choosing the blue link clicks the left menu item (both links looks the same) they dont get logged out.

EDIT: The user is logged out also if he clicks the left menu item.

Also, I don't get this error even if I click on the blue link, I tried in OSX with chrome, safari and firefox and Windows 8 with IE, even in Safari for iOS.

The two guys with that error used Windows with Chrome, Firefox and IE.

I thought it was an error with the action I was linking in the button but I changed it and still got the error.

I was thinking in a session issue or a cookie issue but I don't know what exactly to test, because I tested it in the same Browsers and didn't get the error.

Just to note, I'm using Rights module and we are testing the app in different locations (I can't go where the other two guys are to see if it has something to do with the ISP, but I don't think it is). Any suggestions?

4

0 回答 0