ChiliProject is not maintained anymore.
Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and
we urge all existing users to migrate their data to a maintained
system, e.g. Redmine. We will
provide a migration script later. In the meantime, you can use the
instructions by
Christian Daehn.
Forums » Discuss »
Login to multiple subdomains, one chili instance
Added by André Cardoso at 2011-09-17 04:42 pm
Hi. I have a problem here :)
I've successfully installed chili. Now, I've also created a bunch of projects which I'd like to make available on specific subdomains.
So I've managed to work with apache's mod_rewrite in order to redirect the project's url to another subdomain. For example:
http://main.com --> http://main.com
http://main.com/projects/xpto --> http://xpto.main.com/projects/xpto
Despite the usefulness of what I've done with the rules, I wanted to know how to solve a specific problem:
- The redirects work, but they ask me for login whenever I change domain. Is there a way to avoid this? From the moment I login on "main.com" I want to be automatically logged in onto the sub-domains.
Can this be accomplished?
Thank you in advance!
André
André Cardoso wrote:
Despite the usefulness of what I've done with the rules, I wanted to know how to solve a specific problem:
- The redirects work, but they ask me for login whenever I change domain. Is there a way to avoid this? From the moment I login on "main.com" I want to be automatically logged in onto the sub-domains.
This is a problem with how cookies work: You can't access a cookie for a domain from a subdomain, i.e. you can't access for foo.com
when you visit bar.foo.com
. In general, you can only set cookies for your host and can only access those, one exception being that subdomains can "share" cookies, i.e. bar.foo.com
and baz.foo.com
can set and access cookies to .foo.com
.
Can this be accomplished?
Probably, but it seems like the wrong answer to whatever problem you are trying to solve.
It might work if you force the domain of the cookie in your config to .main.com
and change your landing domain to www.main.com
so that it is a subdomain too.