Keep user session with different domains

Sorry for my english, I’ll try to explain my problem simplely.

I’ve installed a wp multisite in local with 2 sites (for now) :
– main.fr
– second.com

I wish that a user can log on from the front office of main.fr and he always be connected on second.com and vice versa.

1- I tested without the MU Domain mapping plugin that is no longer needed with the latest versions of WP because we can edit the site domain directly from the backoffice.

If the user logs on main.fr, he create a valid cookie on main.fr and not keep his active session on second.com.

If we have set the same domain with subdirectories it works (and also with subdomains) because the cookie is valid on the all domain : logical.

2- I tested with the MU Domain mapping plugin by declaring my mapping on my second site (with subdirectories for example).

There, when the user connects to main.fr (and thus creates a valid cookie on main.fr), his session is kept on second.com because in fact it is the same domain managed by redirects via MU Domain mapping.

By cons, when the user connects to second.com, its session is not preserved, logical.

Problem: I absolutely have to keep different domain names.

How can I make the user keep his connection regardless of the site of my network on which he authenticates?

I started to dig the idea of an SSO but it is laborious.

Thank you in advance for your help.

Read more here:: Keep user session with different domains

Leave a Reply

Your email address will not be published. Required fields are marked *