Integration when not on exact same domain Integration when not on exact same domain
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Integration when not on exact same domain

Started by graemerae, August 30, 2005, 10:02:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

graemerae


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.





graemerae


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?

Nibbler


graemerae


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.


Nibbler

You'd be suprised. What is the exact problem you are experiencing? Please post a test user account if you have login issues.

graemerae

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.


Nibbler

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.

graemerae

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.