PDA

View Full Version : Multiple Domain Cookies


CTM
03-23-2005, 03:58 PM
Is it possible to set my cookies for multiple domains? Or would I have to custom script that?

E.g. :

I have domain1.com and domain2.com

I want it so when you do www.domain1.com/forums/ it uses the same cookies as www.domain2.com/forums/ ( domain1 being an parked domain )

jbischke
03-24-2005, 02:13 AM
Hey CTM. I'd like to know the very same thing. I am trying to "split" my vBulletin forums so that a couple of categories are under one domain and a couple of categories are listed under another. Although I've seen several discussions related to this here, there doesn't seem to be a definitive answer.

Anyone have any ideas?

Zachery
03-24-2005, 02:21 AM
Is it possible to set my cookies for multiple domains? Or would I have to custom script that?

E.g. :

I have domain1.com and domain2.com

I want it so when you do www.domain1.com/forums/ it uses the same cookies as www.domain2.com/forums/ ( domain1 being an parked domain )
Nope, cookies are domain specific

jbischke
03-24-2005, 02:29 AM
OK, so is there a way to accomplish the following:

www.domain1.com/forum1
www.domain2.com/forum2

User logs into forum1 and does not need to have a separate user account to log in to forum2.

Ideally, this would be seamless in the sense that a user logged in to one set of forums would not need to "re-log-in" to the other set of forums. However, I'm cool with it being a bit of a hassle as long as they don't actually have to have separate user accounts.

Any ideas?

Marco van Herwaarden
03-24-2005, 09:53 AM
Since the login is cookie based, this will not (without some major modification) work either IMHO.

But maybe someone got a briljant idea.

SteveC
03-24-2005, 01:05 PM
I'm trying to do something very similar. My plan is to use a script to grab the login info, and pass it to the other site and use a script there to autolog them in. You can get some measure of security by encrypting the header info that's passed and having the 2nd site only accept a link from the first.

HOWEVER, I'm having one strange problem. With Certain mac users, I can't grab their user info. I've tried to grab both the userid var and the cookie for bbuserid

Here's a test script I'm using.

<?php
$bbuserid = intval($_COOKIE[bbuserid]);
echo "bbuid is ";
echo $bbuserid;
$userid=$userid;
echo "uid= ";
echo $userid
?>

I put this script in the BBS directory and made it accessible from a link in a post. For most users it properly displays their id. But from some, even though they are logged in and have cookies enabled, it gives null values.

What am I doing wrong?

CTM
03-25-2005, 02:41 AM
No idea. I was asking if anyone could do it :)