Syncing Users and Data

I have 2 sites, one is a WP site, one which is made with HTML and PHP. Is there a way to sync users so when I log into one site, it is logged in to the other site too. I would like to sync user data too. There are a few ways which I have found, but led me to a dead end:

OAuth
One way would be to become an Identity Provider of some sort, such as an OAuth provider like Github, Google and some of Microsoft’s services. However, there was no clear explanation as to how to do it.

Sync User Tables
Another way is to sync user tables as suggested by Kinsta. However, it requires using the same database, which would slow down my sites and wouldn’t really be a clever nor efficient way to do this.

So could someone suggest a different approach to this?

You could have two approaches to this problem:
1 - You have a server that runs and updates the website offline
2 - You make it so that when you go to a page on the website it sends you to one page, checks if your logged in on the other and if you are then logs you in on that site to.

Both of these methods could be quite difficult to setup, of your using two completly different domains. Its easy if you want to do it across subdomains & a main domain as you just the PHP Session Cookie to the main domain.

This is not an easy thing to setup or make, and therefore whichever method you choose could take a while to setup.

3 Likes

This option seems quite similar to OAuth, so I’ll go with this option.

2 Likes

If you need any help setting this up, just DM me and i’ll be happy to help :smile:

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.