PDA

View Full Version : Dynamic cookie domains


clindh
10-22-2004, 07:30 AM
This may (hopefylly) already exist:

I want my forum to be usable from several different subdomains with single login, as well as allowing more domains.

Today I have:

siteA.domainA.com
siteB.domainA.com
siteC.domainA.com

Thus the cookie domain is ".domainA.com"

Now, we want to add www.domainB.com. Cookiedomain must then be changed, but I still want to keep the single login feature for the domainA.com sites - thus I can't set it to blank.

(I understand that it will not be single login between domainA and domainB, that's no problem)

How can I make the vb3 cookie domain more dynamic than being stored in the database? Ideally, for my use, it would pick the host domain from the request, strip down to the last two (.domainA.com, .domainB.com etc) and set the vb3 cookie domain from this -- instead of looking in the database.

Anyone done this yet?