I have an Yii project evolving for a year or so. It happened so that all user related stuff (such as profile view and registration) is managed by UserController. So it looks strange that login action remains in SiteController so far, as it is in the standard template. Today I decided to move this action from SiteController to UserController, but have spent a couple of hours to no avail.
Just after the code movement I discovered a very strange behaviour that ‘user/login’ get redirected to ‘site/login’. It took some time to dig out that Yii’s CWebUser has public $loginUrl variable, which apparently interfere in the process. I changed its value in my decendant class to ‘array(’/user/login’)’. But now the browser complains about infinite redirection. This is bacause in responce to GET /user/login HTTP/1.1 I always receive HTTP/1.1 302 Found Location: http://localhost/user/login, which is the same.