# Problems with navigation after log in

**URL:** <https://www.ruby-forum.com/t/problems-with-navigation-after-log-in/74378>\
**Category:** Rails\
**Created:** [November 6, 2006, 12:48am UTC](https://www.ruby-forum.com/t/problems-with-navigation-after-log-in/74378 "2006-11-06T00:48:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [November 6, 2006, 12:48am UTC](https://www.ruby-forum.com/t/problems-with-navigation-after-log-in/74378/1 "2006-11-06T00:48:19Z")

</div>

Hi all,

I’m struggling about the following login issue:  
I have to sites site A and site B.  
One link “login” on site A navigates me to site B. On site B I enter  
username and password. If I write a “redirect\_to :back” then I’ll be  
forwarded from site B to site B. But I want to redirect after login from  
Site B to Site A. Does anyone know how to manage that?

Regards,  
Y

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [November 6, 2006, 1:05am UTC](https://www.ruby-forum.com/t/problems-with-navigation-after-log-in/74378/2 "2006-11-06T01:05:36Z")

</div>

Yu Co wrote:

> Hi all,
> 
> I’m struggling about the following login issue:  
> I have to sites site A and site B.  
> One link “login” on site A navigates me to site B. On site B I enter  
> username and password. If I write a “redirect\_to :back” then I’ll be  
> forwarded from site B to site B. But I want to redirect after login from  
> Site B to Site A. Does anyone know how to manage that?
> 
> Regards,  
> Y

Try to do some debugging … I suggest using breakpointer … simply put  
a call to “breakpoint” in your code where you want to break, and start  
script/breakpointer in a new shell … this will give you an irb console  
to your rails application at the breakpoint.

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [November 7, 2006, 11:04am UTC](https://www.ruby-forum.com/t/problems-with-navigation-after-log-in/74378/3 "2006-11-07T11:04:49Z")

</div>

On Mon, 2006-11-06 at 00:48 +0100, Yu Co wrote:

> Hi all,
> 
> I’m struggling about the following login issue:  
> I have to sites site A and site B.  
> One link “login” on site A navigates me to site B. On site B I enter  
> username and password. If I write a “redirect\_to :back” then I’ll be  
> forwarded from site B to site B. But I want to redirect after login from  
> Site B to Site A. Does anyone know how to manage that?

* * *

[http://rails.rubyonrails.org/classes/ActionController/Base.html#M000209](http://rails.rubyonrails.org/classes/ActionController/Base.html#M000209)

you can ‘redirect’ to anywhere you want

Craig

---

<div class="post-metadata">

**Author:** ![yussibaer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/e79b87/32.png) [@yussibaer](https://www.ruby-forum.com/u/yussibaer)\
**Post date:** [November 7, 2006, 11:06am UTC](https://www.ruby-forum.com/t/problems-with-navigation-after-log-in/74378/4 "2006-11-07T11:06:51Z")

</div>

FWIW - You should keep in mind that you will loose your session  
variables when moving between sites A and B if they reside on different  
domains. This is true even when switching between [www.siteA.com](http://www.siteA.com) and  
[siteA.com](http://siteA.com) (without the www).
