Redirection After Logging

I have a scenario.Page A with a login button.When I login the page gets redirected to profile page but I want to redirect to page A.

Any help…


If I understand correctly you just want to return to a page you came from before you ended up on a login page?

I suspect that somewhere in your controller, in login action you will have a piece of code that would look akin to this:


Instead of that you can use


To set Yii::app()->user->returnUrl up, simply set it like this before you send user from your A page:


[size="1"]Disc: All controler and action names are not representative of their real names[/size]

Now you are talking about a particular controller and an action.

What to do if I have 2 controllers i.e

Two different pages A and B ,and after login I need to redirect to those previous pages.


do I need to comment the $returnurl variable in UserModule.php??