I''ve been reading on the mailing list about sharing a session between different domains and I can understand why it it a problem. What I want to do, though, is to share a session between subdomains: a.x.com, b.x.com, c.x.com. I have been able to do this in PHP before by telling PHP that the domain for the cookie was ''.x.com'' and voila! session sharing for all those subdomains. Is there any way to do this with Rails? Any yay/nay/pointers would be appreciated. Thanks in advance, -- Adrian Madrid HyperX Inc. Mobile: 801.815.1870 Office: 801.566.0670 aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org www.hyperxmedia.com 9000 S. 45 W. Sandy, UT 84070 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Correct me if I''m wrong, but I think the ability to set ".x.com" is part of the general cookie specification. If that''s the case, then you should be able to pull it off in Rails. I''m just getting into Rails, but in the Rails beta book, there''s a section on cookies and sessions, and setting :session_domain in your controller. If you have the book, check out page 305. I would explain it, but I''m not at the level yet to just sit down and do that. Hope I helped a bit. - David Balatero On Thu, 14 Jul 2005, Adrian Madrid wrote:> I''ve been reading on the mailing list about sharing a session between > different domains and I can understand why it it a problem. What I want to > do, though, is to share a session between subdomains: a.x.com, b.x.com, > c.x.com. I have been able to do this in PHP before by telling PHP that the > domain for the cookie was ''.x.com'' and voila! session sharing for all those > subdomains. Is there any way to do this with Rails? Any yay/nay/pointers > would be appreciated. > > Thanks in advance, > > -- > Adrian Madrid > HyperX Inc. Mobile: 801.815.1870 > Office: 801.566.0670 aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org www.hyperxmedia.com > 9000 S. 45 W. > Sandy, UT 84070 > >
Thanks! I didn''t recall that section in the book at all so I guess it''s time for a second read and I guess this time I will pay more atention. that was exactly what I was looking for. Thanks again, Adrian Madrid D. Balatero wrote:> Correct me if I''m wrong, but I think the ability to set ".x.com" is > part of the general cookie specification. If that''s the case, then you > should be able to pull it off in Rails. I''m just getting into Rails, > but in the Rails beta book, there''s a section on cookies and sessions, > and setting :session_domain in your controller. If you have the book, > check out page 305. I would explain it, but I''m not at the level yet > to just sit down and do that. Hope I helped a bit. > > - David Balatero > > > On Thu, 14 Jul 2005, Adrian Madrid wrote: > >> I''ve been reading on the mailing list about sharing a session between >> different domains and I can understand why it it a problem. What I >> want to do, though, is to share a session between subdomains: >> a.x.com, b.x.com, c.x.com. I have been able to do this in PHP before >> by telling PHP that the domain for the cookie was ''.x.com'' and voila! >> session sharing for all those subdomains. Is there any way to do this >> with Rails? Any yay/nay/pointers would be appreciated. >> >> Thanks in advance, >> >> -- >> Adrian Madrid >> HyperX Inc. Mobile: 801.815.1870 >> Office: 801.566.0670 aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org www.hyperxmedia.com >> 9000 S. 45 W. >> Sandy, UT 84070 >> >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Adrian Madrid HyperX Inc. Mobile: 801.815.1870 Office: 801.566.0670 aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org www.hyperxmedia.com 9000 S. 45 W. Sandy, UT 84070 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 7/14/05, Adrian Madrid <aemadrid-kSB444ljgzMmlAP/+Wk3EA@public.gmane.org> wrote:> Thanks! I didn''t recall that section in the book at all so I guess it''s > time for a second read and I guess this time I will pay more atention. that > was exactly what I was looking for.Yup, it''s in the book, and the wiki. ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:session_domain => ''x.com'') http://wiki.rubyonrails.com/rails/show/HowtoChangeSessionOptions http://rails.rubyonrails.com/classes/ActionController/Base.html#M000178 (process_cgi) -- rick http://techno-weenie.net