I remember struggling a bit to make it work, and I have tried several different recommendations I found in these forums. Now there is this guide that may be very helpful
https://bbpress.org/forums/topic/wordpress-and-bbpress-integration-101
Let me tell you what I have defined in my config files, to make it work seamlessly:
1 – wp-config
SECRET_KEY your value
AUTH_KEY your value
SECURE_AUTH_KEY your value
LOGGED_IN_KEY your value
NONCE_KEY your value
then, at the end of the wp-config file
define('COOKIEHASH', 'your value');
define('COOKIE_DOMAIN', '.www.yourdomain.com');
define('SITECOOKIEPATH', '/wp-admin');
define('COOKIEPATH', '/');
– on the cookie_domain there must be a . (period) before the url
– sitecookiepath is for root installations, if you have WP in a subdirectory, then change the path to, for example /blog/wp-admin
– cookiepath is OK with just ‘/’ (also if WP is in a subdirectory, at least this was my case, even if the integration plugin told me otherwise, which did not work for me)
2 – bb-config
BB_AUTH_KEY to match the WP key
BB_SECURE_AUTH_KEY to match the WP key
BB_LOGGED_IN_KEY to match the WP key
BB_NONCE_KEY to match the WP key
then, at the end of the bb-config file I have
// Start integration speedups
// WordPress database integration speedup
$bb->wp_table_prefix = 'yourprefix_';
// WordPress cookie integration speedup
$bb->wp_siteurl = 'url to match what you have in WP general settings';
$bb->wp_home = 'url to match what you have in WP general settings';
$bb->cookiepath = '/';
$bb->authcookie = 'wordpress_here goes the same sequence of numbers to match the cookiehash in wp-config';
$bb->secure_auth_cookie = 'wordpress_sec_here goes the same sequence of numbers to match the cookiehash in wp-config';
$bb->logged_in_cookie = 'wordpress_logged_in_here goes the same sequence of numbers to match the cookiehash in wp-config';
$bb->admin_cookie_path = '/forums-directory/bb-admin';
$bb->core_plugins_cookie_path = '/forums-directory/bb-plugins';
$bb->user_plugins_cookie_path = '/forums-directory/my-plugins';
$bb->sitecookiepath = '';
$bb->wp_admin_cookie_path = '/wp-admin';
$bb->wp_plugins_cookie_path = '/wp-content/plugins';
// End integration speedups
– the last two if WP is installed at the root, otherwise
‘/blog-directory/wp-admin’
‘/blog-directory/wp-content/plugins’;
to get sets of keys
https://api.wordpress.org/secret-key/1.1/
https://api.wordpress.org/secret-key/1.1/salt
I can’t remember how I got that cookiehash value…
a possible helpful thread, just in case
https://bbpress.org/forums/topic/where-do-i-define-user_cookie-pass_cookie-auth_cookie-secure_auth_cookie-log
Currently on WP 2.8.6 and bbPress 1.0.2
I hope this helps.