On 17 Mar 2009, at 10:45, Xdmx Xdmx wrote:
>
> I need this to distinguish different requests (eg
> username.users.localhost and name.blogs.localhost).
>
> I've read that to solve this i've to set to share the domain in the
> cookie, but i've tried theese and nothing worked :(
>
> ActionController
> ::CgiRequest::DEFAULT_SESSION_OPTIONS[:session_domain] =
> '.localhost'
>
> ActionController::Base.session_options[:session_domain] = '.localhost'
>
> and even config.action_controller.session.merge({:domain =>
> '.localhost'})
>
> i've tried both with '.localhost', 'localhost', '.users.localhost' and
> 'users.localhost', but nothing...

Your web browser won't allow you to set a top level cookie (ie one  
on .localhost), to the web browser it's as if you tried to set one  
for .com

In the app i'm working on right now environment.rb has

config.action_controller.session = {
     :session_domain => "chat.local",
     :session_key => '_hermes_session',
...
}

and I share the same session across foo.chat.local, bar.chat.local

But it won't share it with any of the other apps that I work with (eg  
someotherapp.local). If you're trying to have username.users.localhost  
and name.blogs.localhost share sessions then that won't work just like  
that - the domain need to have more segments in common.

Fred


>
>
> i'm running rails 2.2.2 with webrick (dev mode)... (in production i  
> run
> apache with passenger, but i haven't tried there yet)
>
> Any idea on how i can solve this?
> -- 
> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to