bbPress

Simple, fast, elegant

bbPress Plugin Browser »

Freshly Baked Cookies for bbPress (0.0.3)

Download

Version: 0.0.3

Last Updated: 2009-3-13

Requires bbPress Version: 0.9 or higher

Compatible up to: 0.9

Author Homepage »

Plugin Homepage »

Donate to this plugin »

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(2)

Your Rating

Author: _ck_

Allows bbPress 0.9 to use WordPress 2.6, 2.7 or 2.8 cookies during stand-alone (simple) integration.

This plugin only been tested on a very basic setup, however it should be safe to try as it doesn't change any data and others report success when using it.

It can only be used on stand-alone (simple) integration, not "deep" or "full" integration.

NOTE: you cannot downgrade from bbPress to 1.0 to 0.9 without converting database, this plugin does NOT do that for you.


  1. _ck_

    Moderator

    An alternate method would be to use Ann's idea of downgrading WP 2.7 cookies so that it uses the old WP 2.5 cookies and becomes compatible again with bbPress 0.9

    http://superann.com/2009/02/26/wordpress-26-27-bbpress-09-cookie-integration-plugin/

    and her technique might just work with deep integration too, in theory.

    Posted: 1 year ago #
  2. I'm having a bit of a hard time with this. Which of the three keys do I need to add to the bb-config.php?

    Posted: 1 year ago #
  3. _ck_

    Moderator

    You should see

    define('LOGGED_IN_KEY',   ...

    in your wp-config.php

    copy that line near the top of the plugin (replace the line that is already there for it)

    Then go to on your WordPress
    http://your-site-name/wp-admin/options.php

    and find the line for LOGGED_IN_SALT

    and copy that value into this part near the top of the plugin (instead of "replace this")

    define('LOGGED_IN_SALT', 'replace this');

    and then it should work.
    Remember to do all the other integration parts first.

    Posted: 1 year ago #
  4. Yeah - it's the "other integration parts" thing that I'm having an issue with - there are 3 keys in the wp-config.php and space for only 1 in the bb-config.php. I haven't been able to find which one goes where. I did beat my head against a wall on the second one for a while looking through the PHP code in options.php though, before figuring out to view it in a browser. I'm still getting over a minor case of the stupids brought on by doing inventory.

    Posted: 1 year ago #
  5. _ck_

    Moderator

    When using this plugin, you only need the 3 keys in wp-config.php

    Then you copy one of the keys LOGGED_IN_KEY to the top of this plugin, or optionally you could put it in bb-config.php but I don't recommend that since it's not native to bbpress 0.9

    Believe it or not, people often look at the source code when I tell them to go to page xyz for some reason, which is why i started to put the http:// in front of filenames I give in the hope they understand it's through the web, not the source. Let me know if you think of a better way to explain it.

    Posted: 1 year ago #
  6. So what do I put in the bb-config.php for BB_SECRET_KEY or does this method bypass that altogether? From what you've said, my setup should be working but no dice.

    Posted: 1 year ago #
  7. _ck_

    Moderator

    BB_SECRET_KEY is ignored once you use this plugin.
    You can leave it in there if you'd like, or leave it out, makes no difference.

    You can leave it in there in case you want to use the alternate technique to rollback WordPress 2.7's cookies to match 2.5.1/bbpress 0.9 via Ann's plugin instead.

    If your salt and logged_in_key are correct and this still isn't working it might be because you don't have the proper WordPress URL set up in the bbPress integration menu. If you examine your cookies and the cookie name is not the same on both WP and bbPress, that's the problem.

    You might find Ann's plugin easier to install.

    Posted: 1 year ago #
  8. I'll play with it some more next week and report my results. I'd rather stick with the newer cookies, mostly because I'm stubborn. The names don't seem to be the same, but the URLs are. Thanks for all your help on this.

    Posted: 1 year ago #
  9. _ck_

    Moderator

    Show me the cookie name from your WP side vs what bbPress is trying to do.

    If it's just the number part, that means it's calculating the cookiehash incorrectly which is based on the URL it thinks WP is installed at. We can either fix that or force the cookiehash to be identical to the WP side manually.

    If that name part is wrong but the number is the same, that's super easy to fix.

    Posted: 1 year ago #
  10. ccvp

    Member

    In WPMu 2.7 both parameter (LOGGED_IN_KEY , LOGGED_IN_SALT) are defined in wp-config.php

    In WPMU the COOKIEHASH values has been define in wp-settings.php like
    define('COOKIEHASH', '');
    not
    define('COOKIEHASH', md5(get_option('siteurl')));

    So must be change in your plugin it to work properly under Wordpress MU.

    For increase the security of the cookie, I change the definition of COOKIEHASH


    define('COOKIEHASH', md5(LOGGED_IN_SALT.LOGGED_IN_KEY));

    in the wp-config.php and in the _freshly-baked-cookies.php

    work fine.

    Thanks for this GREAT plugin.

    Posted: 1 year ago #
  11. This is what I have:
    bbPress:
    wordpress_logged_in_3c7af0a21d645194cabd3965df468b37
    johnmc%7C1236186986%7Cb79b29f9d808d35cad55796dda2cf4d0

    WordPress:
    wordpress_logged_in_566aa6a4748d08549933e157e66906c6
    johnmc%7C1236187137%7C458a6a1c40208b3837a70d29c4d3a78a

    Posted: 1 year ago #
  12. _ck_

    Moderator

    You need to change your password immediately on your site because you just published your login cookie publically which means anyone could forge a cookie to manipulate your website.

    I only asked for the cookie name and not the content for that very reason.

    The different logged_in cookie numbers mean the cookiehash is wrong on the bbpress side.

    The wordpress url you are using in your bbPress integration settings in the admin menus must be wrong. It should be set to the exact same url you use inside of your wordpress configuration.

    If you can't get it to work, change the top of the plugin from

    define('COOKIEHASH', md5($bb->wp_siteurl));

    to

    define('COOKIEHASH', '566aa6a4748d08549933e157e66906c6');
    Posted: 1 year ago #
  13. Gah! I knew I shouldn't have attempted to use my brain so early. I've changed it and beaten myself for doing such a thing. There's something screwy in my settings, so I'll check those a bit later on. Even manually setting the COOKIEHASH, it doesn't get set properly.

    Posted: 1 year ago #
  14. softtouch_ph

    Member

    Hi,
    I do not get it to work...

    I followed all the instructions here, but WP creates a cookie
    wordpress_logged_in_7846143b1662170d7c01987b65e6e3d0
    and bbpress creates
    wordpress_logged_in_378b028fd6ea769142b9cfb691f2f0e1

    What am I doing wrong? I copied the logged_in_key and salt as instructed, the plugin is also installed

    Posted: 1 year ago #
  15. _ck_

    Moderator

    softtouch, try replacing this line in the plugin

    define('COOKIEHASH', md5($bb->wp_siteurl));

    with this one instead

    define('COOKIEHASH', '7846143b1662170d7c01987b65e6e3d0');
    Posted: 1 year ago #
  16. I was having the same issues with the hashes. A little experimentation with the php md5 function revealed that the difference is due to trailing slashes: wordpress seems to remove a trailing slash from siteurl before creating its cookie hash, bbpress seems to add one. Changing 'siteurl' in the wordpress settings to with or without a trailing slash did not change the hashes one iota so it's hardcoded. In the plugin, I got round this by:


    define('COOKIEHASH', md5(rtrim($bb->wp_siteurl, "/")));

    This seemed to work. Or at least, it got me to the next problem ...

    Posted: 1 year ago #
  17. _ck_

    Moderator

    Thank you very much for that report Andrew. I will add that as a fix now.

    Posted: 1 year ago #
  18. Hey Ck, simple question (I think this plugin is already integrated in BBpress but still begs the question), when I log out in BBpress, I can still login to my wordpress dashboard, is it possible to logout on both systems?

    Posted: 1 year ago #
  19. The plugin works partially for me.

    My tests were done with WordPress 2.7.1 and bb-press 0.9.0.4.
    Wordpress installed on http://site.local/wordpress
    bbPress installed on http://site.local/wordpress/forums

    Login/logout from WordPress reflects perfectly on bb-press. That's fine I think is the only thing the plugin is going to do.

    Login/logout from bb-press does not change my status on WordPress. So I have to arrange the users are always doing their login/logout from WordPress. I think the plugin does not do that.

    I'm wrong? Or when login/logout on bb-press these changes should be reflected on WordPress also?

    Thanks for clarifiying.

    Posted: 1 year ago #

RSS feed for this topic

Add a Comment »

You must log in to post.

Code is Poetry.