MyBB Community Forums

Full Version: How to make 1 login work on multiple forums on diffrent domains on the same server?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How to make 1 login work on multiple forums on diffrent domains on the same server?

Its probably complicated but i need to know how to do this for my sites and i cant find a guide or anything anywere.

Can anyone help me with this?
Sessions are handled through cookies. Cookies cannot be shared across domains. At best, your members will have to log in and out on a per-domain basis.
Set the cookie domain to nothing I guess. You'll probably have to register on each subdomain with the same user name and password
Ok what i am talking about is having the username and password work on all forums not just 1.
When you create the user or the person joins you can have the info spread across different databases. Anything you do will require custom coding. It won't be easy or pretty. Do you really need this?
The easiest way to do this is really to have one database covering the entire "site", and use different prefixes for each forum, such as mybb1_, mybb2_ etc.

Then alter /inc/datahandlers/user.php to update/create a user in the tables needed.

That way, settings, themes etc. will all be different per forum Smile
Hello,

Could someone elaborate on how I could do this?

I will have three forums domains

forum1.mydomain.com
forum2.mydomain.com
forum3.mydomain.com

If someone logs in on forum1, I would like the login to be valid on forum2.

Is that possible?

(2008-09-23, 08:00 AM)Tom.M Wrote: [ -> ]The easiest way to do this is really to have one database covering the entire "site", and use different prefixes for each forum, such as mybb1_, mybb2_ etc.

Then alter /inc/datahandlers/user.php to update/create a user in the tables needed.

That way, settings, themes etc. will all be different per forum Smile
it's usually not such a big problem
<?php $olddirectory = getcwd();
define("IN_MYBB", 1);
chdir('/www/htdocs/LALALA/forum');
require_once ("/www/htdocs/LALALA/forum/global.php");
chdir ($olddirectory);
?>
that stuff is at the head of any page on my site, changing the executional folder to where forum resides (to grab cookie info), then returns to the actual site folder.

this should work as long as any of your subdomains have access to the /www/htdocs/... folder AND as long as all subdomains are willing to share the same cookie (without the subdomain in it).

-- oh wait, boinnggg.. different DOMAINS.. not subdomains .. well then... nope.
My situation is different subdomains....does that still work? I have it set up to share the same database, but each table prefix is the same as the subdomain name

(2008-10-22, 02:57 PM)TStarGermany Wrote: [ -> ]it's usually not such a big problem
<?php $olddirectory = getcwd();
define("IN_MYBB", 1);
chdir('/www/htdocs/LALALA/forum');
require_once ("/www/htdocs/LALALA/forum/global.php");
chdir ($olddirectory);
?>
that stuff is at the head of any page on my site, changing the executional folder to where forum resides (to grab cookie info), then returns to the actual site folder.

this should work as long as any of your subdomains have access to the /www/htdocs/... folder AND as long as all subdomains are willing to share the same cookie (without the subdomain in it).

-- oh wait, boinnggg.. different DOMAINS.. not subdomains .. well then... nope.
my stuff works with different subdomains... the table prefix of the database is not important for this one to work,it's the cookie bound to a particular domain (or subdomain).. for me to work, all cookies are not bound to the subdomain, but to the superior domain, i have no problems with it.
Pages: 1 2