cookie integration problem wp2.8 – bb 1.0 rc-2
i’ve upgraded wp from 2.7.1 to 2.8, checked all the key for the cookie and
AUTH_KEY in wp-config is the same of BB_AUTH_KEY in bb-config, the same for SECURE_AUTH_KEY – BB_SECURE_AUTH_KEY,
LOGGED_IN_KEY – BB_LOGGED_IN_KEY, NONCE_KEY – BB_NONCE_KEY.
i’ve installed and activated the plugin bbPress Integration 1.0-rc-2 configured with the url of bbpress (http://www.site.com/forums/) saved the option, copy/past in wp-config.php for the “code” in the box which is:
i’m able to login in bbpress side, and i see the cookie wordpress_e99db1aecc456188d6dc1ccc37528ff8 for /forums/bb-admin, /forums/bb-plugins, /forums/my-plugins, /wp-admin, /wp-content/plugins and /.
i’ve other 2 cookies bb-user-settings-1 and bb-user-settings-time-1 for /forums/bb-admin.
when i try to go in wp-admin i’m slogged from wp and 2 new cookies appear, wordpress_test_cookie.
when i try to login in WP side i’m redirected to the login page every time.
if i remove the code generated by the Sam’s plugin i can login but i’m logged out from bbpress…
how resolve this problem? thanks for the help.
Does your site always have “www” in front of it?
In any case, try changing the COOKIE_DOMAIN in WordPress like so (note the dot in front of the domain):
Also enter this value in bb-config on the bbPress side:
$bb->cookiedomain = '.site.com';
Doing this will log you out, but you should be able to just log back in.
yes Sam i’ve always the www in front.
i’ve modified COOKIE_DOMAIN in wp-config with define(‘COOKIE_DOMAIN’, ‘.site.com’); (without www but with .)
and in bb-config $bb->cookiedomain = ‘.site.com';
I can login in bbpress and in WP when i try to login i’m redirected to the same page (wp-login)… so with this nothing change.
What else can I try?
This gave me a couple ideas to fix both our problems. Changing
define('COOKIEPATH', '...');fixed half of my problem (in other words, removing the wp-admin from the end of SITECOOKIEPATH, since I noticed that having it there sets a cookie with a Path like /yawp/wp-adminwp-admin), I can at least include the Integration plugin’s suggested settings in wp-config now. But I still get a second logged_in cookie when logging into the bbp side, that logging out from WP cannot remove. IE, /yawp/ and /yawp for the Path:
I haven’t figured out how to make bbP stop giving the second cookie without the trailing / but at least it now removes the one with the trailing / when logging out from WP (WP still thinks it is logged in due to the non-trailing slash cookie and shows the site admin link in meta, but won’t allow me re-enter the admin after logging out. At that point it acts as the situation arturo84 describes as his original problem, but also fails to logout from the bbp side)!
Ok I think I found a fix for this and I’m submitting a patch to trac now
Ok arturo84, make the changes Sam suggested by dropping the www from your cookie domain settings in each config, then put the Integration plugin code back into wp-config. In wp-config the Integration plugin recommends the following settings among others:
change SITECOOKIEPATH to match COOKIEPATH like this:
Then for the bb-config you should include the recommended integration speedups from the bottom of your bb-admin/options-wordpress.php page, and make sure that the cookiedomain doesn’t have www, and that both cookiepath and sitecookiepath are / as well:
$bb->cookiepath = '/';
$bb->sitecookiepath = '/';
Then go into bb-settings.php (in the base bbpress folder). Look to line 768 if you have rc-2. Change line 768 from:
$bb->sitecookiepath = rtrim( trim( $bb->sitecookiepath ), " tnrx0B/" );
$bb->sitecookiepath = rtrim( trim( $bb->sitecookiepath ), " tnrx0B" );
$_bb_sitecookiepath = rtrim( trim( $bb->sitecookiepath ), " tnrx0B/" );
Notice the removed / before the ” and that you need to add the second variable below it as that variable is used to set the other cookie paths.
Upload the altered bb-settings.php over your current one and it should fix the problem. Please come back and let us know if it works for you too
I’m able to integrate WP2.8 and BBP1.0 without this.
The settings put out by the Integration plugin are not REQUIREMENTS, they are RECOMMENDED. Basically automated guesses based on your wordpress/bbpress configuration. I can’t say I’ve integrated any two sites in the exact same way, as the cookie and domain setups are almost always different between installs, so it requires some trial and error to get them lined up.
Do you have WP in a subfolder of your main site? Do you have bbP in a subfolder of WP? Are you 100% certain that you can log in from bbP and then logout from WP, and that you actually get logged out from both when you try that order? I think the easiest way to stop all these integration headaches is to put up a document with a dummy wp-config.php and bb-config.php that have been tested in the situation mentioned and in the situation where WP is the base site folder and bbP is a subfolder of the base.
Everything but that order of action works fine for me without adding anything to bb-config and without adding anything but cookiepath to wp-config. However, every way I tried to line up the configs I’d always get that second logged_in cookie without a trailing / when logging in from bbP and WP won’t get rid of it.
Looking in the bb-settings.php I see that cookiepath always gets a trailing / added on and sitecookiepath always gets the trailing / trimmed, so the check to see if they both exist and are the same, never returns true, and thus bbP always sets 2 logged_in cookies.
I was having the same troubles as the original poster. WordPress 2.8 and BBPress 1.0 RC2, whenever I logged into BBP I couldn’t log into WP without logging out of BBP first. All the settings matched in both configs and adding in the suggested code (be it from the WP plugin which gave me a COOKIEHASH, a COOKIE_DOMAIN, a SITECOOKIEPATH, and a COOKIEPATH or from the BBP integration page which gave me just a COOKIE_DOMAIN and a COOKIEPATH) didn’t change anything. I tried junsuijin’s suggestions and now when I log into one it logs me out of the other. Anybody know how to get this running properly?
Please excuse my previous longwindedness as it seems it was unnecessary. I just tested a site with WP in the base folder and bbP in a subfolder of WP, and a site with WP in a subfolder of the base folder with bbP in a subfolder of WP. Neither site needs anything added to either config file except that the 3 secret keys match between them (my nonce keys also match but that shouldn’t matter). It is also necessary to fill in the wp-admin’s bbPress Integration Plugin settings, and the bb-admin’s WordPress Integration settings.
On any sites I’ve tested where I have WP in a subfolder of the base folder, and bbP in a subfolder of the WP folder, bbP sets 2 logged_in cookies, one with a trailing / and one without, which poses a problem since WP doesn’t get rid of the one without a trailing / and thus WP cannot logout from bbP if the user logs in from bbP. After I made the change mentioned above to bb-settings.php and tested it on both sites mentioned I found both sites integrating as expected and the double logged_in cookie from bbP login was no longer a problem. That’s why I submitted the patch to Trac.
There is a problem with the integration plugin. Some code which was meant to distinguish between WordPress and WPMU is now failing.
I’ll have a new plugin out soon. When you upgrade the plugin, you will need to remove the settings it previously instructed you to use in wp-config.php and then check the admin page in WordPress for the new settings to use.
I just realized this topic was for WP2.8, and I’m talking about WPMU2.7.1.
There is now a fix in bbPress trunk for an associated issue where bbPress would not clear all wordpress_logged_in cookies that were generated by WordPress.
Seriously, my life is wasting away chasing WordPress cookies.
The fix on the WordPress side is to remove these defines from
The plugin will be updated soon, but remove those if you are running WordPress standard (i.e. Non-WPMU)
had the same problem here
the removing the define cookiehash and sitecookiepath fixed the problem
i’ve downloaded the latest trunk at the mooment is rev # 2192, updated my installation.
bb-config side i’ve $bb->cookiedomain = ‘.www.site.com'; (i’ve tested without www but nothing change…)
in wp-config i’ve deleted
define(‘COOKIE_DOMAIN’, ‘.www.site.com’); (or without www, but nothing change)
when i login in bb i’m logged out to wp and vice versa, i’m waiting for your plugin to test it.
thanks for your help!
Is this WPMU? If not remove the dot at the start of both domains.
If you are using WPMU you might need to sit tight while I troubleshoot that one.
is wp normal (not mu)
i’ve removed the dot but nothing change, seeing the cookie have a dot in front… i’m waiting! thanks for all Sam for your patience
Hi, I have the same or similar problem. I removed the two defines mentioned above and I can login to BBpress and WP but not simultaneously. Users are showing up in both places when they register through bbp.
Also, I installed Community User and I was wondering if there was a way to have the profiles on BBp match those produced by Community User? The CU profiles display great within WP.
Thanks for any help and I will be looking for the integration fix. Congratulations on your great work.
Wp 2.8 bbp latest
I have the same trouble. WP is installed under a folder of the site (www.site.com/folder), and BBP under a sub-folder (www.site.com/folder/forum)
Nothing changes with the last file found in the trunk. Same trouble.
Thank you very much in advance for your help
I was facing the same problem here, but I could solve it. Basically, I put this on
And this in
$bb->cookiedomain = '.www.rodrigoghedin.com.br';
I’m running a test installation. Main WordPress is in a directory (/teste), and bbPress is a sub-directory (/teste/bbpress). Right now, it’s working fine.
Just upgraded to 1.0 RC3:
Within the process it does give the “cookiedomain” instructions – THANKS!. Unfortunately my login problems continue. I can now login to both but only into one dashboard at a time. Also, I have to delete cookies everytime I log out of one and try to get into the other…
you’ve tried my directions in this post?
Thanks! I have but I think I have so many configurations going I have lost track. Here are the defines (including your fix, thank you again) in my bb-config file:
define(‘BB_SECRET_KEY’, ‘”mathes WP-config secret key;
define( ‘BB_AUTH_KEY’, ‘”mathes WP-config key”;
define( ‘BB_SECURE_AUTH_KEY’, ‘”mathes WP-config key”;
define( ‘BB_LOGGED_IN_KEY’, ‘”mathes WP-config key”;
define( ‘BB_NONCE_KEY’, ‘”mathes WP-config key”;
$bb_table_prefix = ‘bb_';
$bb->cookiedomain = ‘www.volleyballnh.com';
Here is my WP-config info:
define(‘SECRET_KEY’, ‘”mathes WP-config secret key;
define( ‘AUTH_KEY’, ‘”mathes WP-config key”;
define( ‘SECURE_AUTH_KEY’, ‘”mathes WP-config key”;
define( ‘LOGGED_IN_KEY’, ‘”mathes WP-config key”;
define( ‘NONCE_KEY’, ‘”mathes WP-config key”;
$table_prefix = ‘wp_';
What am I missing (or do I need to delete)? Thanks in advance for your help.
- You must be logged in to reply to this topic.