I would like to know if it is possible to share Authentication cookies between 2 url''s with ruby. Does anyone know how to? 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 Jun 26, 10:50 pm, Sam Ginko <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I would like to know if it is possible to share Authentication cookies > between 2 url''s with ruby. Does anyone know how to? >Well for starters the contents of the authentication cookie needs to contain something the 2 apps understand (assuming it''s two different apps), so for example just sticking user.id in the cookie won''t be enough if user ids don''t match between the 2 apps. Secondly you''ll have to set the domain of the cookie appropriately. Normally if you go to foo.bar.com you''ll get a cookie valid for foo.bar.com. Instead you need to set the domain of the cookie to ''.bar.com'' which means that anything ending in bar.com will receive your cookie Fred> thanks > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Well for starters the contents of the authentication cookie needs to > contain something the 2 apps understand (assuming it''s two different > apps), so for example just sticking user.id in the cookie won''t be > enough if user ids don''t match between the 2 apps. > Secondly you''ll have to set the domain of the cookie appropriately. > Normally if you go to foo.bar.com you''ll get a cookie valid for > foo.bar.com. Instead you need to set the domain of the cookie to > ''.bar.com'' which means that anything ending in bar.com will receive > your cookie > > FredI forgot to mention that the 2 URL''s are completely different but they are using the same database. I''m not sure if this is possible two write one cookie that checks authentication for both sites. If this does not work is there any other way I can do this? 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 27 Jun 2008, at 12:06, Sam Ginko wrote:> > >> Well for starters the contents of the authentication cookie needs to >> contain something the 2 apps understand (assuming it''s two different >> apps), so for example just sticking user.id in the cookie won''t be >> enough if user ids don''t match between the 2 apps. >> Secondly you''ll have to set the domain of the cookie appropriately. >> Normally if you go to foo.bar.com you''ll get a cookie valid for >> foo.bar.com. Instead you need to set the domain of the cookie to >> ''.bar.com'' which means that anything ending in bar.com will receive >> your cookie >> >> Fred > > I forgot to mention that the 2 URL''s are completely different but > they > are using the same database. I''m not sure if this is possible two > write > one cookie that checks authentication for both sites. If this does not > work is there any other way I can do this?In that case you can''t share a cookie. Have you considered OpenID ? Fred> > > 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 27 Jun 2008, at 12:06, Sam Ginko wrote: > In that case you can''t share a cookie. Have you considered OpenID ? > > FredI''m not familiar with that what is it? -- 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 27 Jun 2008, at 12:21, Sam Ginko wrote:> > Frederick Cheung wrote: >> On 27 Jun 2008, at 12:06, Sam Ginko wrote: >> In that case you can''t share a cookie. Have you considered OpenID ? >> >> Fred > > I''m not familiar with that what is it?http://openid.net/ There''s a rails plugin for it Fred> > -- > 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 27 Jun 2008, at 12:21, Sam Ginko wrote: > >> >> Frederick Cheung wrote: >>> On 27 Jun 2008, at 12:06, Sam Ginko wrote: >>> In that case you can''t share a cookie. Have you considered OpenID ? >>> >>> Fred >> >> I''m not familiar with that what is it? > > http://openid.net/ > > There''s a rails plugin for it > > Fredcan''t thank you enough for all your help. kind regards mauro -- 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 -~----------~----~----~----~------~----~------~--~---