Sessions and subdomains


I’m currently developing an application in which accounts are managed
by subdomains (,…). I was wondering
which is the best way to enable users to navigate through different
accounts. The options are:

  1. Leave your subdomain and keep your session across multiple
    subdomains allowing users to navigate through each account. (I think
    I’ll have to modify some session variables in environment.rb)
  2. Stay on your own subdomain and have a new resource set to navigate
    between accounts without leaving your own subdomain (ex:,

Which should be the best option and why (pros and cons)? Thanks,

Please can anyone pinpoint in some direction on what’s the best