After testing with sso I decided to wait until a production version is available. On one site I made a discovery, after testing with sso on this site, which can be usefull for many DA users.
I have this easy solution succesfully implemented on three different DA sites. After logging in on one domain I am logged in in all other domains.
My installation where it is working:
- DA installed
- all domains end in the same domainname like:
+ www.example.com or example.com
+ dom1.example.com
+ dom2.example.com
+ dom3.example.com
- all domains share only one settings file --> the default settings.php
Solution:
Define in the settings.php file the cookie_domain like:
$cookie_domain = 'example.com';
Attention:
- it is not working allways with this settings change, it seems to be dependent on the installed software and or version on your server. At least on one DA site it fails.
- maybe you have to delete all cookies for the domains before it starts working. Log in afterwards.
- I only tested with Drupal 5.
That's all folks!
I hope most of you will benefit of this alternative.
Comments
Comment #1
agentrickardThis is already in the documentation. Cookie-sharing on subdomains is fully supported by the cookie standard. You can't share cookies across domains otherwise, because it is a security risk.
Generally, you should use '.example.com' as the cookie domain.
Comment #2
promesAgentrickard you are right. I forgot to mention you don't have to implement additional modules, like sso, to be able to log in to all domains (as defined in #1).
I think most people don't set the cookie domain in the settings file (as I never did before, since by default it is unset) and don't know about this behaviour. That's why I made this issue.
Maybe it is wise to point this out in your documentation. A lot of people are struggling with sso now and some of them don't have to use that module.
Comment #3
croryx commentedAs agentrickard points out, this behavior is already documented:
README.txt 1.4.1 - Logging In To Multiple Domains
INSTALL.txt 4.3 - $cookie_domain
Comment #4
seddonym commentedThanks for documenting this - very helpful.
Comment #5
agentrickardIF someone wants to take a stab at creating/updating handbook pages, that would be great.
http://drupal.org/node/432266
Comment #6
mrgoltra commentedsubscribing+
Hello. I was wondering if you commented out
# $db_prefix = array(
# 'default' => '',
# 'users' => 'database name here',
# 'sessions' => 'database name here',
# 'role' => 'database name here',
# 'authmap' => 'database name here',
# );
I am trying to setup DA using the same setup as yours and I can't seem to login to the other subdomains.
site.com
1.site.com
2.site.com
3.site.com
4.site.com
Comment #7
mably commentedA new lightweight SSO solution has been implemented in the Domain Extras project.