Sharing tables after the fact

Events happening in the community are now at Drupal community events on www.drupal.org.
drm's picture

I've got a drupal multisite - different domains for the sites - with no shared tables or databases. But they do actually all have the same user accounts (though different roles for those users), and I want to have people log in once and then be logged in on all the sites.

To use multisite login, the users tables must be shared, and I think sessions also? Is there an issue with making these tables shared after the fact when there are already users tables in each database?

Alternately maybe I could just use the hook_user with op-login and copy the sessions table row to other sites?

Comments

I'm having a two-domain setup

rpsu's picture

I'm having a two-domain setup like www.example.com and ssl.example.com.
In settings.php I have
$cookie_domain = 'example.com';

and also some shared tables (at the moment for Drl5, note comment also)
'authmap' => 'shared.',
'openid_associations' => 'shared.', // not needed if you are not using openid-login
'profile_fields' => 'shared.', // profile-tables needed only if you are using profile-module
'profile_values' => 'shared.', // profile-tables needed only if you are using profile-module
'role' => 'shared.', // i'm sharing also roles to ease setup on both domains
'sequences' => 'shared.', // remove in D6, not needed anymore since next-available-id's are checked directly from tables in question
'sessions' => 'shared.', // this is IMPORTANT
'users' => 'shared.', // this is IMPORTANT
'users_roles' => 'shared.', // if you want users to have same roles on all subdomains, add this also
'users_uid_seq' => 'shared.', // for pgsql only

However the mimimun of shared tables you need are only sessions and users (see http://drupal.org/node/291373) and cookie-setup.

I'm also using three databases:
1. www-db for www.example.com
2. ssl-db for ssl.examplel.com
3. shared-db for shared tables (notice dot at the end of shared tables name)

This I made simply because I felt it made my life a bit easier instead of having shared tables in the middle of all others or separated only with a prefix - you may like it otherwise though.

--
Perttu Ehn

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: