views:

109

answers:

0

I'll like an opinion on the following issue. I'm currently developing an application in which accounts are managed by subdomains (foo.example.com,bar.example.com...). I was wondering which is the best way to enable users to navigate through different accounts. The options I have in mind are:

1) Make each user leave their account subdomain and keep their session across multiple subdomains allowing them to navigate through various accounts. (I'll have to modify some session variables in environment.rb) IF I LET THE USERS SESSIONS PERSIST BETWEEN DIFFERENT SUBDOMAINS, I'LL HAVE TO ADD ADDITIONAL CODE ON MY VIEWS AND CONTROLLERS TO BLOCK ACCESS FOR CERTAIN ACTIONS.

2) Make each user stay on their own subdomain and have a new resource set up to navigate between accounts without leaving their personal subdomain (ex: foo.example.com/accounts/2, foo.example.com/accounts/3) MAY NOT BE A VERY RESTFUL SOLUTION.

Which should be the best option and why (pros and cons)? I'll like to hear from you on this one.