PDA

View Full Version : Use same vB on different Domains (cookies)


Paris Holley
10-02-2004, 10:00 PM
I haven't tested it in all circumstances but in only the way i needed. This may not be the best method but I think its the only one that works as of right now.

Tested Domain Situations:
-------------------------------
1site.com
2site.com ( which the real url is 1site.com/2site/ )
-------------------------------

Open Functions.php and find
{ // try unsetting without the / at the end

before each setcookie function ( should be 3 within about 25 lines or so ) add

setcookie($name, $value, $expire, "your-path", "your-domain", $secure);

this should write the cookies for each domain you set it for and allow people to view each one and not have to log in. Please give me feed back on this for i would love to see my first vb hack work :)

Velocd
10-02-2004, 10:34 PM
From vBulletin.com:


vBulletin license grants you the right to run one instance (a single installation) of the Software on one web server and one web site for each license purchased. Each license may power one instance of the Software on one domain. For each installed instance of the Software, a separate license is required. Modifications to the software or database to circumvent the one-license-one-board rule are prohibited.


I'm uncertain, but your suggested use of this hack may violate that rule (in bold).

Paris Holley
10-02-2004, 10:36 PM
well I have my site, and my forums, and I use it so that if they are on the site they have to login using the forums system....I guess this could be used to violate that rule, but it all depends on the person using it...

by saying that i mean,

on site1 it includes the global site1/site2/global.php but people see the forums as site2.com, so if people want to integrate the vbulletin login system on differen't domains they can...

Talisman
10-02-2004, 10:56 PM
Umm.. congrats on the hack, Paris ... (I think).

Not to take away from the enthusiasm of the moment, but I think I'm missing something here. Why would we want to do this? Could you give some example of how this might be used?

... and does this violate Jelsoft's terms and conditions, or not?

Paris Holley
10-02-2004, 11:03 PM
u can have a vb installed if its not being viewed by the public....and yes this can be found on the 2 domains but is only being used on one...

secondly im using it so that, you have to be logged on the forums to view the site ( must be logged on site2.com to view site1.com content ) and in order to do that, you must include the global file from the site2 directory ( which is located on the site1.com/site2 folder but the public accesses it from site2.com )..and since cookies are created for both domains it will work...make sense?

Talisman
10-02-2004, 11:30 PM
I guess I'm still confused, so let me see if I can follow what you're saying. It's one (single) forum that you (and your admins, I presume) can access from both domains. But the viewing public and your forum members can only see the board from Site 2.

If they go to Site 1, it's not visible to them at all?

Or, you mean this is really a site within a site? ... Or that Site 2 is more of a sub-site to Site 1? From the way you have this set up, I guess Site 2 is really a subdomain of Site 1.... you just want it to appear as someplace different, yes?

(...sigh)

Sorry to be such a pain on this, I'm sure it's really simple. I'm just trying to figure out what/why we might do this.

Paris Holley
10-02-2004, 11:40 PM
ok...site2.com is just another way to go site1/site2 but site1/site2 is not accessible by the public...no one goes to site1/site2, I just use that directory to include the global file so that you can use the $bbuserinfo["username"] variable on site1, but in order to do that you have to create cookies for both domains so when they login site2 and view site1 the variable is register and not showing as "Unregistered"...and yes basicly site2 is a subdomain or the site within the site but appears that it is somewhere else...

Talisman
10-02-2004, 11:53 PM
Okay. Thanks, again.

I think I get it now. Your members get to this forum by going to Site 2. Since they don't know the rest of this, they think the forum is located ... there. This really takes them to a subdomain of Site 1 but you don't want them to know Site 1 exists at all, so that's why you have the domains shuffled around like this.

Erwin
10-03-2004, 12:24 AM
Interesting. What about logouts? You'd want to delete all those cookies too.

Paris Holley
10-03-2004, 12:29 AM
Interesting. What about logouts? You'd want to delete all those cookies too.

ah yes, i forgot about that....

Mephisteus
10-03-2004, 08:37 AM
Isn't this a default feature through the Settings part of admincp? Just wondering...

AlexanderT
10-03-2004, 09:53 AM
Often a site is accessible through various aliases. So for instance you could access the same site with

namea.com
namea.net
nameb.com
nameb.net

That would be 4 different domain names, but only one copy of vB on one server - so perfectly legal. If the hack works as advertised, it is a nice addition.

Paris Holley
10-03-2004, 01:03 PM
yes it works just like that, I just have to make it so that it logs out too....

noox
10-15-2004, 02:07 AM
I'm pretty sure that this will only work in your situation with subdomains or paths.

You cannot set (or read) a cookie for a foreign domain. This would be a big security problem.

So you only may set a cooky for the same domain and same path. Additionally for parent directories or the "root" domain. So it is possible to set a cookie from www.domain.com for domain.com which can be read from domain.com.

The IE has a small glitch if you do not set the cookie domain: If you then set a cookie to domain.com you cannot override it from www.domain.com. Let's assume a simple auto-login script. Somebody logs in using domain.com. Later he comes back using www.domain.com. He is automatically logged in but cannot logout as long as he tries it on the domain www.domain.com! So setting the cookie domain is generally a good practice.

If you realy want to set a cookie for another domain there are some possibilities. You could insert an image or an iframe within your page where you transfer the information via query string. This image or page in the iframe is located on the other domain and sets the cookie.

Because of security issues the newer browsers standard security settings prohibit setting cookies this way on domains not equal to the main site or the main frameset. This is for instance a problem for the banner ad agencies.

So my only idea is to forward to the a script on the second domain which sets the cookie. This script forwards back to the initial script. I havn't tried that yet, but it should work.

noox
10-16-2004, 06:12 PM
I've found another solution which should work in some situations:
Use the IP as cookie domain. This will only work if all domains you want to have access are using the same IP. This is the case if you have additional domains pointing to the same webhosting account.

Attention: Do not use this if foreign websites also use the same IP. (As on most shared hosts.) This would introduce a big security hole!

Floris
10-25-2004, 05:00 PM
I've found another solution which should work in some situations:
Use the IP as cookie domain. This will only work if all domains you want to have access are using the same IP. This is the case if you have additional domains pointing to the same webhosting account.

Attention: Do not use this if foreign websites also use the same IP. (As on most shared hosts.) This would introduce a big security hole!
More info?

Zach
10-27-2004, 08:14 PM
From vBulletin.com:



I'm uncertain, but your suggested use of this hack may violate that rule (in bold).

I have hundreds of domain names, I park them on my forums.

Just because you can get to it by two or three hundred different domain names doesnt mean that its a different forum.

Otherwise I would be one broke mofo :)


(I also 301 - doesnt stop search engines from listing them more than once, or get them to pull listings anytime soon after I make a change and forget to 301 right away - I only 301 certain forum pages, since I use things like global.html (.php) in hundreds of different places on many different domain names that I do not want 301ed to the wrong place)

Zach
10-27-2004, 08:16 PM
I've found another solution which should work in some situations:
Use the IP as cookie domain. This will only work if all domains you want to have access are using the same IP. This is the case if you have additional domains pointing to the same webhosting account.

Attention: Do not use this if foreign websites also use the same IP. (As on most shared hosts.) This would introduce a big security hole!

I think I love you.

peterska2
10-27-2004, 11:21 PM
I'm gonna watch this as I have trouble with cookies on my forums since I went to dual domain names.

geezzaa
11-10-2004, 09:55 PM
Let me get this right, im dislexic so its got me a bit confused
I have 1 site that i want to have just a normal https for my visitors and i want to add a https connection
Does this mean i can http://www.ukcultivator.biz and https//:www.ukcultivator.net and run them to the same site
Will this still mean i can have both http and https connections on the same forum

Thanks in advance

CarlitoBrigante
11-18-2004, 11:02 PM
I really need this hack, but I'd like to know if this is the right way for me to do it. I have three big websites, let's call them xboxwebsite.com, xbox2website.com, gamecubewebsite.com; all websites share the same forum at forums.networkwebsite.com.

Now, in my sites I'd like to ask users to login using vbulletin to be greeted, see their forums stats, and let them add comments to news items; comments are displayed next to the news items and in the main forum.

How can I setup a unique cookie for all the network?

cschuck3
12-06-2004, 07:14 AM
I was woundering is this cold help me with my issues, I have a web ( domain1 ) which is used to sale products. This account is setup on a shared server. I then have VB installed ( domain1/xxx/xxx/forms/ ) I have setup a fake ip ( domain2 ) that points to ( domain2/xxx/xxx/forums/ ), The issues I have is all internal link refer to the ( domain2/xxx/xxx/forums/ ) location. When I want them to point to ( domain2/xxx/xxx/forums/ ). Also based on the domain used the user always have to relogin. Is there another solution form this... or should I just setup another shared hosting account for VB?

dfc005
03-25-2008, 10:56 PM
Anyone got a solution for having multiple domains and only having to login once?

CLUB AMPLE
10-06-2008, 06:35 PM
I have 2 sites... one has adult content.. one does not.

I want users to be able to register and or sign in on either site with their existing user name.

Must still allow new unique name registrations on both sites.

Must block similar name registrations on both sites.

Reason for the hack... say "mike" registers at the non adult site... and then on the adult site another "mike" registers.. but its not the same mike... i do not want people getting confused as to who is who. Mike on the adult site might uploads pics that Mike on the non adult site would never upload.... so i want to make sure that is there is a similar name.. it IS the same person.

Does any of that make sense?

CLUB AMPLE
10-10-2008, 04:03 PM
Can anyone direct me to the best mod or coder who can help me with this ?

I have 2 sites... one has adult content.. one does not.

I want users to be able to register and or sign in on either site with their existing user name.

Must still allow new unique name registrations on both sites.

Must block similar name registrations on both sites.

Reason for the hack... say "mike" registers at the non adult site... and then on the adult site another "mike" registers.. but its not the same mike... i do not want people getting confused as to who is who. Mike on the adult site might uploads pics that Mike on the non adult site would never upload.... so i want to make sure that is there is a similar name.. it IS the same person.

Does any of that make sense?