954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

one account for multiple sites

how can i use a single account on my double sites.........either with cookies or any thing else...........!!

suppose i have http://www.mydomain.com and also
http://another.mydomain.com how can it use my single account with these both sites..........!!

shishtawitch
Junior Poster in Training
55 posts since Oct 2009
Reputation Points: 10
Solved Threads: 2
 

Cookies and sessions won't work because they are separate domains so I would suggest having them both read a common mysql database where user data will be stored so when a user logs into each, their preferences+passwords will still be the same as the other site. If however you do not want the user to have to log in twice then when a user logs in record their ip address in the user database and when the user visits the second site, the second site will check if the users ip is in the database and if it is it will send a cookie.

Sorry if that is too brief but there is so much to explain in so fewer words...

cwarn23
Occupation: Genius
Team Colleague
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
 

but how google handles a single account for multiple sites.......!!

if i store cookies................do you think this should work........!!

shishtawitch
Junior Poster in Training
55 posts since Oct 2009
Reputation Points: 10
Solved Threads: 2
 

Why did you start another thread when you posted a similar one and didn't bother replying to it?

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 
but how google handles a single account for multiple sites.......!!


Well cookies are designed to serve one domain only and google's login uses Java applets. So perhaps with googles login their Java applet could write to a file on the local system or something like that but this obviously doesn't suit your situation as you want php (The server side and not client side). Could you post your login script and show in a code box your database structure (column names and tables) as I shall help you code this multi site login.

cwarn23
Occupation: Genius
Team Colleague
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You