views:

45

answers:

4

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?

A: 

You may need to set cookies for each of the domains when a user logins at a particular site.

Alan Haggai Alavi
+1  A: 

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.

Philippe Leybaert
A: 

You should research "Single sign-on" or SSO as it is fondly abbreviated.

Lots of info if you just search for the right terms!

Cerebrus
A: 

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.

dusoft