Edge (2.3.0) session_domain cookies problem

27 views
Skip to first unread message

LesFreeman

unread,
Jan 28, 2009, 11:26:14 PM1/28/09
to Ruby on Rails: Talk
Hello,
I am working on a project that uses subdomain keyed accounts.
Everything works great (using SubdomainFu for much of that heavly
lifting) until I get to storing sessions across the subdomains. I want
the entire site to share cookies, such as the auth_token from
restful_authentication.

I've read numerous blog posts regarding this setup, and everyone seems
to say that if you set the session_domain everything should work fine:

#development.rb:
ActionController::Base.session_options[:session_domain] =
'equvents.local'

I've also tried:
ActionController::Base.session_options[:session_domain] =
'.equvents.local'

And what seems to be an older method:
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update
(:session_domain => ".equvents.local")

The trouble is, this isn't having any effect on the domain my app
stores cookies for. The cookies are still getting set individually for
www.equvents.local, testaccount.equvents.local, equvents.local, etc.

What am I missing?

Thanks so much for your help!
Les Freeman

LesFreeman

unread,
Jan 29, 2009, 11:41:09 PM1/29/09
to Ruby on Rails: Talk
It appears that, at least in Edge 2.3.0, you no longer
use :session_domain, but just :domain:

config.action_controller.session = {
:domain => ".equvents.local"
}

I've not fully tested yet, but things seem to be working so far.
Hopefully this will save someone else some hair pulling.
Les

On Jan 28, 8:26 pm, LesFreeman <lesliefreem...@gmail.com> wrote:
> Hello,
> I am working on a project that uses subdomain keyed accounts.
> Everything works great (using SubdomainFu for much of that heavly
> lifting) until I get to storing sessions across the subdomains. I want
> the entire site to share cookies, such as the auth_token from
> restful_authentication.
>
> I've read numerous blog posts regarding this setup, and everyone seems
> to say that if you set the session_domain everything should work fine:
>
> #development.rb:
> ActionController::Base.session_options[:session_domain] =
> 'equvents.local'
>
> I've also tried:
> ActionController::Base.session_options[:session_domain] =
> '.equvents.local'
>
> And what seems to be an older method:
> ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update
> (:session_domain => ".equvents.local")
>
> The trouble is, this isn't having any effect on the domain my app
> stores cookies for. The cookies are still getting set individually forwww.equvents.local, testaccount.equvents.local, equvents.local, etc.
Reply all
Reply to author
Forward
0 new messages