bbPress 0.9 and WordPressMU 2.7

I’ve just integrated cookie logins between bbPress 0.9.04 and WordPressMU 2.7.1 fort the second time. It took me a while to remember all the steps that were necessary the first time, so I’m documenting them here.

This is a quick and dirty integration. There might be a more fanciful or secure way of doing this. It works (for me, no guarantees!) and it’s easy. I think it will work for WordPress and WordPressMU but I’ve only tested on WordPressMU.

Firstly, you need to sync all the key and salt values in wp-config.php and bb-config.php. Set them in bb-config.php first. You need two lines like this:
define('BB_SECRET_KEY', 'secret_key_here');
define('BB_SECRET_SALT', 'secret_salt_here');

Generate secrets here.

The next step is to copy those values into wp-config.php. Copy the secret key value into all of these lines:
define('SECRET_KEY', 'secret_key_here');

Then copy the secret salt value into each of these lines:
define('SECRET_SALT', 'secret_salt_here');

It is possible for these to be different on WordPress. That means each cookie will be different. WordPress uses 3 cookies to handle logins. However, that complicates matters with bbPress, so for simplicity, keep them all the same.

You may also need to set COOKIE_DOMAIN and COOKIEPATH in bb-config.php. Check out your forum admin (Settings > WordPress Integration) and it will tell you what to do.

Now go to your forum admin, Settings, WordPress Integration. Click “Show manual config settings:”. Now copy that into bb-config.php. Change this line to:
$bb->authcookie = 'wordpress_logged_in_';

WordPress standalone uses a wacky cookie name, generated randomly, but WordPressMU does not. If you’re using WordPress, you need to change this value. Log into WordPress, check the cookies in your browser, and copy the name here. I think you can also do this by setting COOKIEHASH in your wp-config.php. See this article for more info.

Now when you log into WordPress, you’ll be logged into bbPress. When you log out of WordPress, you’ll be logged out of bbPress. But not vice versa. In order to complete the link so you can log in and out on bbPress, you’ll need to add a little plugin to bbPress. Get the code here and put the file in bb-plugins then activate the plugin via your forum admin. This plugin only works for WordPressMU / bbPress. If you want a version for WordPress, nag me with a comment on this post and I’ll see what I can do. 🙂

Now logins should sync beautifully. If you have any questions, try asking on the bbPress forums.

Leave a Reply

Your email address will not be published. Required fields are marked *