I'd like to seamlessly login users between my sites, located on different domains. (For historical reasons, two different language versions of the site are hosted on different domains....I know... but the user should not need to log in again once changing languages.)
I thought of the following:
- The user is on
a.com
. - The script on
a.com
makes an ajax POST request tob.com
andb.com
responds with a session cookie. - The browser sets that session cookie for
b.com
. - The script sets
window.location = 'b.com'
. - The user sees himself automatically logged-in on
b.com
.
Will this method work?