I'm trying to create a cross domain sign in just like Google. So you have the same account for your youtube, gmail, google+, etc. However, there are several questions I'm confusing about:

Suppose I have 5 websites, I don't want to transfer any data about the user besides his/her **email, username and password**. If I have only 1 user database instead of 5, every time I call the user database to access user's profile picture, username and etc, do I need to call the remote database?

I've been thinking about having a remote user and session database so every child site access that instead of local user and session database. But my application uses the table extensively and i'm worried about the performance of getting the data from a remote database every time.

How can I implement this in a clean way so every child site can easily access the user info locally, and they also share the same login/logout process just like Google and its products? (I'm using a PHP framework called Yii with MySQL)

---

I've come up with the following solution and I posted it as an answer as well, please advice if there is any issue about this? Thank you guys for help.

1. Have a user table in every child site, say child1.com & child2.com
2. Have a super user table in the parent site, say parent.com
3. When user logs into child1.com, check identity, redirect to parent.com/child1 to register or login. Once it's done, redirect back to child1 with an encrypted URL to login the user automatically. If the user's info has changed from the parent database, we can sync it here to the child database, (If it's a register process instead of a login process, write the user\_id, username and email as well into the database so you can access this locally from child1.com)
4. When user logs into child2.com, it redirects to parent.com/child2, however, the users has been authenticated to parent1.com, so it redirects the user to child2 with out encrypted URL, so child2.com logs the user in directly.
5. For logout process, logout child1.com & curl other encrypted logout link to logout this user from other sites say child2.com or parent.com