views:

25

answers:

2

Hello all

i have 2 domains e.g. test1.com and test2.com and i need user login cross at this 2 domains.

both domains run on same server, i hobe for help, :)

A: 

You cannot use a cookie as cookies are only visible on same domain.

One solution is to redirect the user twice, once to the other site including some authentication info on the url to have that site set its on logged in cookie, and a second redirect back to the logged in page on the first site.

The reason to do two redirects is that many browsers do not accept 3:rd party cookies and setting the cookie through an image or javascript link might not work.

David Mårtensson
A: 

As there is no way to set something like "global cookies", you have to solve this on the server side somehow.

joni