Website Construction

multi-site conection (Sigle login for multiple sites)

Submitted by shadow89, , Thread ID: 102598

Thread Closed
30-09-2018, 06:05 AM
This post was last modified: 30-09-2018, 06:11 AM by shadow89
#1
So... I'm going to be working on a website that will consist of multiple sites conected as one large website. (ex: domain.com,item1.domain.com, item2.domain.com) but I want to set it up where it onlyrequires to sign into any of the sites (connected accounts) and not have to sign in again when switching from(let's say) domain.com to item1.domain.com I know wordpress multi site is an option, but I honestly like to say away from wordpress if possible and I know it can be done. I'm guessing it'sdatabase related ssuebut not sure on how to go at it as I've never done this kind of connection before and figured I'd see if someone on here has the answers I need.
A Shadow On The wall, A Ghost In The Fog..

RE: multi-site conection (Sigle login for multiple sites)

#2
30-09-2018, 06:05 AM
shadow89 Wrote:
So... I'm going to be working on a website that will consist of multiple sites conected as one large website. (ex: domain.com,item1.domain.com, item2.domain.com) but I want to set it up where it onlyrequires to sign into any of the sites (connected accounts) and not have to sign in again when switching from(let's say) domain.com to item1.domain.com I know wordpress multi site is an option, but I honestly like to say away from wordpress if possible and I know it can be done. I'm guessing it'sdatabase related ssuebut not sure on how to go at it as I've never done this kind of connection before and figured I'd see if someone on here has the answers I need.

Look into prefixes for databases.. ex: app1_db, app2_db... All sites point to one db, prefixes determine what site/app they login from etc...

RE: multi-site conection (Sigle login for multiple sites)

OP
#3
06-10-2018, 06:44 PM
Moneytac Wrote:
Look into prefixes for databases.. ex: app1_db, app2_db... All sites point to one db, prefixes determine what site/app they login from etc...

Ok, I'll do that thanks. I knew there was a way to do it though the database but just wasn't fully sure lol
A Shadow On The wall, A Ghost In The Fog..

RE: multi-site conection (Sigle login for multiple sites)

#4
Put your login system on login.domain.com
call your login classes in any page, including then with php include once
you'll also need a cookie to save the login state, so you do the same thing.
put the session cookie on your login subdomain and require it
~Thank youYuun

RE: multi-site conection (Sigle login for multiple sites)

#5
Nice job. good luck with it
Nice job. good luck with it

RE: multi-site conection (Sigle login for multiple sites)

#6
I think youll need to look at Remote Database Access also to ensure that requests can be made from external servers for authentication etc

RE: multi-site conection (Sigle login for multiple sites)

#7
There are many ways to achieve what you want. If you are looking for the "appropriate" way to structure it, I would suggest to look up SSO (or Single Sign On) which is (as a concept) what you are looking for.

You need to keep in mind how Cross-Origin Resource Sharing (CORS) works as based on your domain structure you will likely encounter issues with it. Specifically, if you have xyz.domain.com then abc.domain.com will NOT necessarily share resources with the prior (because of CORS). You can configure your domains to accept resource sharing from any number of sources but you then have to keep security in mind while you do that.

Long story short, you can achieve what you want very simply if all you are after is a proof of concept, but my advise is always to keep things correct and secure and as such I strongly recommend you look into SSO.

RE: multi-site conection (Sigle login for multiple sites)

#8
Nice share, I will not be using I personally. But I'm sure a lot of people will find it useful.

Users browsing this thread: 1 Guest(s)