Closed (works as designed)
Project:
Domain
Version:
7.x-2.9
Component:
- Domain Alias
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Jul 2011 at 23:27 UTC
Updated:
11 Mar 2012 at 21:44 UTC
I can't find information how to make a single login for users on domain and it subdomains. I know it is possible for a domain and IT SUBdomains (but not in another domain - some internet rule).
At first I thought that DA alias is a different patch for domain, so I have created another "domains" for my subdomains.
domain1.com
subdomain1-of-domain1.com (another domain not aliased)
subdomain2-of-domain1.com (another domain not aliased)
Is there a easy way to change domains to aliases ? It is even needed for shared login ? Do I need to set my cookies to domain1.com for shared login ?
If somebody could explain this process I would be glad. Thx.
Comments
Comment #1
croryx commentedShared logins just require that you set the cookie domain correctly. See the cookie domain section of the documentation for configuring settings.php (http://drupal.org/node/1096962).
Comment #2
kerios83 commented@croryx, thx for this info ! I have set up this correctly (for one domain - $cookie_domain = '.domain1.com';) - I did not have to change domains to aliases. But I have also few other domains I want to use. So if all of those domains will point to one cookie, nothing wrong is gona happen ?
domain1.com
subdomain1-of-domain1.com (another domain not aliased)
subdomain2-of-domain1.com (another domain not aliased)
domain2.com
subdomain1-of-domain2.com (another domain not aliased)
subdomain2-of-domain2.com (another domain not aliased)
domain3.com
subdomain1-of-domain3.com (another domain not aliased)
subdomain2-of-domain3.com (another domain not aliased)
How to set up this configuration ? So domain1.com user will automaticaly log in to subdomain1-of-domain1.com and domain2.com user will automaticaly log subdomain1-of-domain2.com. I did't test it with one cookie cause I'm biuilding domain2 and it's subdomain atm :) Will this work for me. BTW thx for this GREAT module !
Comment #3
croryx commentedThe great module is all due to @agentrickard, I just help around the queue with the simple stuff when I can, and since your current question isn't simple enough for me to know the answer to I'll have to leave this for him.
Comment #4
agentrickardYou would need to wrap $cookie_domain in some logic similar to:
This all goes in settings.php, before the DA include.
Comment #5
agentrickardComment #6
kerios83 commentedThanks for answers guys. I will test it as soon as I finish build sites for rest of the domains.
Comment #7
Punchy commentedHello guys !
I hope this issue match up with my problem !
on my localhost I created 2 domains with (wonderfull) Domain Access module :
domain1.dev
domain2.dev
I'd like when the users log in one of this 2 domains they're automatically log in the other one, is it possible ?
I tried #4, it doesn't work.
Then I tried this :
http://drupal.org/node/1348784
It seems corresponding what I want but it doesn't work, maybe I did it wrong ?
I put this in settings.php before the Domain Access include :
Please can you tell me what I'm doing wrong ?
Thanks for help and sorry for my bad english T__T
Comment #8
agentrickardYou can't do this because browser security won't let you store the same login cookie for two domains that don't share a top level.
e.g. if you had 'example.com' and 'one.example.com', you can share '.example.com'.
In your setup, the Drupal login cookie would get reset every time a user switched domains.
See https://drupal.org/node/1096944 and INSTALL.txt.
Comment #9
agentrickard