I have three websites which are pointed to, by different domain names.
The issue is:
If a user logs in at one domain, it is not reflected in the other two domains, and similarly for logout.
How to maintain session state for two different domains?
I have three websites which are pointed to, by different domain names.
The issue is:
If a user logs in at one domain, it is not reflected in the other two domains, and similarly for logout.
How to maintain session state for two different domains?
You may need to set cookies for each of the domains when a user logins at a particular site.
Session information is linked to a session cookie, and cookies are bound to only one domain, so it's not possible to authenticate against more than one domain with one login form.
You could use some fancy cross-domain javascript, but that's not very easy.
You should research "Single sign-on" or SSO as it is fondly abbreviated.
Lots of info if you just search for the right terms!
you could share session info in a database based on user's IP, user agent string and some more info based on the number of users connecting from the same IP address. you would need to have more data on individual user if multiple user connect from the same IP address.
script would then only access database to fetch session info.