1

I already implemented single sign on (SSO) for sub-domain on same and different server.

Using the following technique:

session_name('example');
session_set_cookie_params(0, '/', '.example.com');
session_start();

d1.example.com on SERVER1
d2.example.com on SERVER1
d3.example.com on SERVER2

and this successfully works.

To create session for sub-domain d3.example.com on SERVER2 i use a curl to invoke a page on that server

But now i added another domain www.different.com to SERVER2, all data, users, services, code are shared from example.com, but its not a subdomain.

I tries same login technique of cURL for this new domain(www.different.com), but failed to login to www.different.com. although user is shown logged-in on all other sites.

Because www.different.com is not a subdomain of example.com, so cookie(i.e. session_set_cookie_params(0, '/', '.example.com'); ) is not written for this site.

I want to know if there any solution that need minimum changes, because there are 18 subdomains working on above scenario. and changing all these is very tedious.

Asad kamran
  • 440
  • 10
  • 21
  • Possible duplicate of http://stackoverflow.com/questions/342378/cross-domain-login-how-to-login-a-user-automatically-when-transferred-from-one – Filippos Karapetis Jun 06 '13 at 08:58

0 Answers0