Writing here to confirm, and because I don’t have git account, so I can’t rise new issue myself. If bug is confirmed, please start a new issue for me. Thx!
- operating system: Windows Seven Home 64-bit
- Web server: XAMPP 1.8.1
- browser type: Chrome 21
- Yii version: 1.1.12
CWebUser.returnUrl always points to “index.php”, if using application only in areas, where you don’t need to login. This is twice inncorrect. First: if user manually login, it will be redirected to index page, instead of page, where he was. Second: it uses “index.php” even if option for showing index.php is disabled in CUrlManager.
Follow these steps (in any Yii application):
- ensure you’re logged off,
- go to any page that requires user to be logged-in,
- login
- you’re redirected back to the page you were - i.e. the one you want to open.
Now, follow these steps:
- ensure you’re logged off,
- go to login page
- login
- you’re redirected back to home page, not the page you were.
It was discussed many times (here and here for example).
It is a bug! There is no reasonable argument for NOT setting returnUrl for "normal" pages (that do not require login). There is no reasoning for redirecting user to home page after he login, if login was requested manually by him, not by application settings. There is no reasonable argument for solving the same situation two different ways – one for manual login and one for automated loging request.
It many situations, this could be really frustrating - i.e. user is reading some article deep in article tree, login, is redirected to home page and have to manually go back to the article, he read. This small bug can in some situations incluence overall opinion user has on page.
In above mentioned topic (and in many mroe) there are many ways discussed to workaround for this problem. If so many users sees this as a problem and looks for a workaround, then this definatelly have to be done on framework level. Especially, if fixing this is just a few lines of code!