I have a strange problem when using Yii::app()->user, If I call it from one method I can’t run almost anything until the running of the script has ended. For example let’s say I have the following method:
public function actionFoo(){
[indent]Yii::app()->user; //just for the example, I know it doesn't mean anything[/indent]
[indent]sleep(30); //just so it won't finish right away[/indent]
[indent]echo "end of function Foo"; [/indent]
}
Now if I call the URL related to actionFoo and after I’ll try to call a different URL from another tab before the first one has finished the following happened:
- If I enter an invalid URL that belongs to the same project I won’t get a response until the end of actionFoo, meaning I won’t get 404 Bad Request.
2.If I enter a valid URL that’s related to a method that also use Yii::app()->user - The same as in #1.
- If I enter a valid URL that’s related to a method that doesn’t use Yii::app()->user - everything seems to work.
Hope everything is clear and if not feel free to ask.