PDA

View Full Version : Setting login cookies for multiple domains


stevensteven
24 Jan 2004, 00:38
If you check out www.votewatch.us you will see that we inserted some PHP to drive the vB login from outside the /forum directory. Votewatch uses several different domains, all pointing to various directories within the root server. For example, we establish a new set of pages each year under a new domain (ie. votewatch2004.org).

Even though a user may be utilizing the same vB instance, they can pass from one domain to another. If they have logged into the first domain, but have not logged into the second, it then can appear to the user that they have been logged out of the system.

As a possible solution, we are exploring the possibility of setting multiple cookies upon login, one for each of the domains in the votewatch family. So that once they logged in to one domain the user is logged in to all of the domains.

I'd appreciate if if I could receive some feedback as to the feasibility of this approach.

Thanks

Steven

bjornstrom
22 Feb 2004, 14:28
Installation
============

Replace "www.vbulletin.org" with your main hostname.

Open config.php
Place this line of code on line 2 - i.e. the line after "<php":

if ($HTTP_HOST!="www.vbulletin.org") { header("Location: http://www.vbulletin.org".$REQUEST_URI); exit; }

Close and upload config.php

And hey presto, it's done.
Visitors to any page on http://vbulletin.org will be magically transformed to that same page on http://www.vbulletin.org