I have a simple Rails app and to avoid another login name for users to remember I''m pulling information off our IT run IIS webserver via ColdFusion. I have a simple ColdFusion page called "getLogin.cfm" and it gets the username of the computer visiting the page. So here''s my flow. My rails app links to -> getLogin.cfm gets the username and immediately redirects back to the referring page with the username as a parameter However, if I do a redirect_to "getLogin.cfm", the referring URL that getLogin.cfm see''s is not my Rails app. But if I do a link_to "Get Login", "getLogin.cfm" then the user is forwarded over to getLogin.cfm and redirected back to my Rails app in an instant. I would like to get this situated so the user doesn''t have to click a link in order to login. Is there a way to emulate that click in any way? My controller code (very simple): def index if params[:id].blank? (the link to getLogin.cfm is in my view) else redirect_to :action => ''show'', :id=>params[:id] end end Any thoughts? Thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 10/15/07, Matthew Williams <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I have a simple Rails app and to avoid another login name for users to > remember I''m pulling information off our IT run IIS webserver via > ColdFusion. > > I have a simple ColdFusion page called "getLogin.cfm" and it gets the > username of the computer visiting the page. So here''s my flow.(I assume the .cfm sets a cookie or something; otherwise how does your Rails app know they are logged in?)> > My rails app links to -> getLogin.cfm gets the username and immediately > redirects back to the referring page with the username as a parameter > > However, if I do a redirect_to "getLogin.cfm", the referring URL that > getLogin.cfm see''s is not my Rails app. But if I do a link_to "Get > Login", "getLogin.cfm" then the user is forwarded over to getLogin.cfm > and redirected back to my Rails app in an instant. > > I would like to get this situated so the user doesn''t have to click a > link in order to login.Best bet would be to change the getLogin.cfm so you can pass the page to return to as a parameter. Then pass that with your redirect. The referer is set by the client (browser), so you don''t have control over it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
>> The referer is set by the client (browser), so you don''t have control over it.you might try setting the HTTP_REFERER header yourself before redirecting --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jemminger wrote:>>> The referer is set by the client (browser), so you don''t have control over it. > > you might try setting the HTTP_REFERER header yourself before > redirectingErrr...no. The HTTP_REFERER header is sent by the browser to the server. Setting it on the server is meaningless. As Bob said, you need to pass the URL of the page to return to as a parameter to your ColdFusion request. Pete Yandell http://notahat.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
err... if you''re doing a server side redirect, as in redirect_to, then you can set headers. in this case the server *is* the client for the target URL. at least you could in previous versions, i haven''t tested in current rails: headers["HTTP_REFERER"] = "http://old.url" redirect_to "http://www.new-url.com/" On Oct 15, 10:51 pm, Pete Yandell <p...-AylieETRJAdBDgjK7y7TUQ@public.gmane.org> wrote:> jemminger wrote: > >>> The referer is set by the client (browser), so you don''t have control over it. > > > you might try setting the HTTP_REFERER header yourself before > > redirecting > > Errr...no. The HTTP_REFERER header is sent by the browser to the server. > Setting it on the server is meaningless. > > As Bob said, you need to pass the URL of the page to return to as a > parameter to your ColdFusion request. > > Pete Yandellhttp://notahat.com/--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---