Session problem with subdomains

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 :frowning:

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