Skip to:

Re: WordPress + bbPress Integration 101

Cross-Domain Intergration

I’ve not seen anything about messy cross-domain integrations, so I thought I’d share my method. I’m using WordPress 2.8.6 with BBPress 1.0.2. Your mileage may vary on other versions. I suspect this method is not valid for 2.5/0.9.

The setup:




With shared user tables and database.

The config AUTH_KEY/SECURE_AUTH_KEY/LOGGED_IN_KEY should be the same for all (remember to add BB_ to the forum config files). Within the BBPress admin intergation, have the same auth/secure/logged in values for all forums (remember it’s the value shown within the WordPress options screen, not the values in the config files).

In this case cookiepath should be ‘/’ ($bb->cookiepath = ‘/’; // in bb-config and, define(‘COOKIEPATH’, ‘/’); // in wp-config). Set other $bb->style configurations as you wish.

Basically, everything is the same. Except: The Cookie Domain must be explicitly set**. And not always set to the same value.

In’s wp-config add: define(‘COOKIE_DOMAIN’,’’);

In’s bb-config add: $bb->cookiedomain = ‘’;

So far, so simple.

Now, in theory, can be set with $bb->cookiedomain = ‘’; // But I’ve not tried. Paranoid browsers would surely reject this. Instinctively having the forum rely on something that might look like a security risk is bad.

Instead, try adding this to’s bb-config: $bb->cookiedomain = ‘’; // Users will still need to log in separately when they switch domain, but all the other integration features seem to be fooled, with no adverse problems.

I’d welcome any feedback on this method. I’m still not sure this is the best approach.

( ** Not setting the cookie domain appears to work, until the user switches between domains – doesn’t simply fail to find a cookie set by, it may fail a fresh blog login until cookies are cleared. I’m not sure exactly what’s happening, but it’s messy.)

Skip to toolbar