coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 (BBS) Integration / Bridging => Topic started by: graemerae on August 30, 2005, 10:02:23 PM

Title: Integration when not on exact same domain
Post by: graemerae on August 30, 2005, 10:02:23 PM

In the BB integration docs it says this:

This will work:
Bulletin board: http://yourdomain.com/board/
Coppermine: http://yourdomain.com/gallery/    

This won't work:
Bulletin board: http://board.yourdomain.com/
Coppermine: http://gallery.yourdomain.com/

the cookie names of your bbs and coppermine must not be the same - they must differ!

However, I'm working with a pre-existing set up that I really would prefer NOT to change:

photos.surfline.com  (coppermine 1.3)  - all being imported quite nicely.
forums.surfline.com  (vbulletin3.0.8)

And I'd like to keep the domain structure the same.   It also says "So unless you are an expert, keep things simple and install Coppermine and your bulletin board on the same domain."

So - lets say "Im an expert" :-)  What do I need to do to make sure that I don't get my cookies crossed?   I am on the same high level domain, both parts are physically located on the same box, and I'm comfortable in editing php and dealing with cookies.




Title: Re: Integration when not on exact same domain
Post by: graemerae on August 30, 2005, 10:25:16 PM

OK - I did some digging:

Set cookies on vbulletin to be .mydomain.com (done)  and set them the same in CPG - but where do I set this in CPG?
Title: Re: Integration when not on exact same domain
Post by: Nibbler on August 30, 2005, 10:38:45 PM
Don't set them the same in CPG.
Title: Re: Integration when not on exact same domain
Post by: graemerae on August 30, 2005, 11:29:51 PM

I noticed that in the docs DONT CALL the cookies the same  (my cookies are cpg13_ right?) - so it would be a pretty rare case for me to go into vbulletin and change the cookie names to that!?  This is not something I have to be really careful about (i.e. the cookies are called : "cookie", id see as being an issue,but cpg13_something is not going to interfere.

Title: Re: Integration when not on exact same domain
Post by: Nibbler on August 30, 2005, 11:37:32 PM
You'd be suprised. What is the exact problem you are experiencing? Please post a test user account if you have login issues.
Title: Re: Integration when not on exact same domain
Post by: graemerae on September 07, 2005, 11:15:38 PM
Similar problem:

I have forums.surfline.com - running vbulletin3.0.# dropping cookies .surfline.com/etcetc
I have photos.surfline.com (CPG134) dropping cookies photos.surfline.com/cpg133_etcetc

(we actually use the forums cookies on other parts of our site too (www, etc) so it would be nice to be able to allow photos to do that too)

How do I tell CPG to simply drop cookies callled .surfline.com/cpg133_etetc?

ie how/where do I set the cookie domain in CPG?

Cookie settings in cconfig.php only allow cookie path and cookie name


The problem I see is that when I login to photos.surfline.com I see photos.surfline.com cookies appear, I want to see .surfline.com cookies appear.

PM me and I'll send you a test admin login.  Accounts are disabled except for admins at the moment, as I want to get the bridging launched before I open this to public posting.

Title: Re: Integration when not on exact same domain
Post by: Nibbler on September 08, 2005, 11:30:02 AM
There is no option to set cookie domain in Coppermine. You'd need to search the code for setcookie and specify the domain you want.
Title: Re: Integration when not on exact same domain
Post by: graemerae on September 09, 2005, 12:13:12 AM
OK - I solved this - not too bad - and I'm kinda proud of myself :-)

Using CPG 1.3.4

FIRST: Cleared all Cookies:

Then Using phpMyAdmin I added cookie_domain to the config table.
and populated it with .mydomain.comĀ  (you should probably use a mysql command but I'm not that
familiar with it, so I used phpMyAdmin instead)

CODE CHANGES:

File: lang/english.php
Look for :
array('Path of the cookie used by the script', 'cookie_path', 0),

Add immediately after it:

array('Domain of the cookie', 'cookie_domain', 0),

Now the hard bit:

In the following files:

addfav.php
login.php
logout.php
profile.php
xp_publish.php
include/functions.inc.php


Replaced every occurance of

$CONFIG['cookie_path']

with

$CONFIG['cookie_path'], $CONFIG['cookie_domain']

(I used bbedit and did a batch search and replace)


Bingo - now you can define the cookie for ANY of your own domain.coms, and allow easy bridging between
things like forums.domain.com, gallery.domain.com, www.domain.com etc.