I have created a Domain Record like mysite.example.com and then created an alias for this domain like newexample.com though the domain redirects when going to the newexample.com it does not however, allow a user to login with a registered user for mysite.example.com when trying to login it does nothing but redirect back to newexample.com with a access denied page. Even though the user credentials work for mysite.example.com.

If I try to create a new domain record with the name newexample.com I am unable to register or login with a valid user account. Is this because Domain Access does not support this feature? or Do I have something on my server set up wrong. As for the description at http://drupal.org/project/domain states that "thisexample.com <-- can use any domain string".

I have searched the issue que and it doesn't seem to have any issues regarding this problem.

Thanks

Comments

agentrickard’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I'm sorry. Your first paragraph makes no sense. Please restate more clearly.

This is probably a cookie issue. See $cookie_domain notes in section 4.3 of INSTALL.txt. Either that, or your server doesn't resolve the domains to the same folder.

There are no issues because this is not a bug, you have a configuration issue. Check the instructions in INSTALL.txt.

agentrickard’s picture

Note also that the documentation clearly states that you cannot share login cookies across domains, as you describe.

See also 1.4.1 Logging In To Multiple Domains in README.txt.

dobe’s picture

Sorry for the confusion.

My $cookie_domain is properly set. As I can login fine to example.com. If I change the $cookie_domain to newexample.com. Then of course the newexample.com login works fine and the example.com login does not work anymore. I have also tried implementing

global $_domain;
if ($_domain['domain_id'] == 4) {
$cookie_domain = 'newexample.com';
}
else {
$cookie_domain = 'example.com';
}

But that does not seem to work. Basically does this module work with only sub-domains or can you have multiple Main domains?

dobe’s picture

I think 1.4.1 answered my question as it states:

As a result, you may configure your site as follows, but when you do so,
users cannot be logged through a single sign in.

example.com
one.example.com
myexample.com
thisexample.com

While example.com and one.example.com can share a login cookie, the
other two domains cannot read that cookie. This is an internet standard,
not a bug.

Note: See the INSTALL.txt for instructions regarding Drupal's default
cookie handling.
__________________________________________________________________

So it states

"While example.com and one.example.com can share a login cookie, the other two domains cannot read that cookie." However can those other two domains have there own cookie? I guess.

dobe’s picture

Ok So I created a directory /sites/newexample.com and changed the settings.php for that file with newexample.com as the cookie domain. And everything seems to work however is this the only way?

nonsie’s picture

Domain Access uses a single settings.php file

dobe’s picture

I don't understand that comment. As I have 6 separate settings.php files each in its own folder.

For example:

/sites/mysites.com/settings.php
/sites/thissite.net/settings.php
/sites/whatever.org/settings.php

the mains site uses /sites/default/settings.php

Each containing different $cookie_domain's Therefore the site is now setup so that if the admin user signs into the main domain it can manage the content on each subdomain. However, when you goto the alias that isn't a subdomain. I can now login only to that alias. Which is fine was just wondering if there is a better way of setting this up. So logins work across all domains.

nonsie’s picture

Please see 4. Configuring settings.php of INSTALL.txt. There is only one settings.php file for sites using Domain Access. If you want to login across all domains use a module like SSO (http://drupal.org/project/sso). There's another thread that also covers the same problem #479974: Can't log into to secondary domain

agentrickard’s picture

You also can't call the global $_domain until _after_ the settings.php include.

If you are not sharing top-level domains, simply leave $cookie_domain alone.

agentrickard’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)