Search

bbPress Showcase » WordPress Integration

BB/WP integration, but cookies seem awry.

RSS
  1. ipswitchft
    ipswitchft

    junior member
    Joined: May '09
    Posts: 9

    offline

    I have a WP 2.7.1 / BB 0.9.4 integration running.. its sooo close to perfect, minus one step.

    Account creations are checked against each side and work beautifully.. however, when you log into BB or WP.. it does not automatically log you into the other app. So when I log into the Forums, and click over to the Blog side, it does not think I am logged in.. however my BB credentials do work fine.

    I have Ann Oyama's cookie plugin installed on WP, and the BB integration settings are all set right.

    I'm clearly missing a step somewhere, and was wondering how to go about testing..

    The site is up at http://www.filetransferplanet.com . Thanks in advance!

    Oh and structurally.. under the domain root, I have the blog and forums living in their own subdirectories, however WP's index is in the root.

    pete

    Posted 2 years ago #
  2. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 882

    offline

    Use a tool or bookmarket to view the cookie set by each side.

    Check to make sure they are using the same cookie name, ie.
    wordpress_123ergjh3kjhsdf12

    also check that they are both using webroot as their path '/'

    and they are using proper domain name starting with a dot (.filetraferplent.com)

    See my 101 integration guide on bbPress in order how to fix those in your bb-config and wp-config.php

    Posted 2 years ago #
  3. ipswitchft
    ipswitchft

    junior member
    Joined: May '09
    Posts: 9

    offline

    thanks _ck_ (and thanks for all the incredible work you put into BB!) ..

    paths and hosts are correct. and the 123ergjh3kjhsdf12 string matches..

    BUT it looks like BB is writing only
    wordpress_123ergjh3kjhsdf12

    while WP is writing
    wordpress_logged_in_123ergjh3kjhsdf12

    i'll keep poking around as maybe i missed a line to add to a config.. but am getting stumped!

    Posted 2 years ago #
  4. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 882

    offline

    Wordpress_logged_in sounds like a remnant from 2.7's newer cookie method, does it still set that after you clear cookies and log in again?

    I guess the lazy fix would be to force bbpress to use the same cookie name via bb-config.php

    $bb->usercookie = 'wordpress_logged_in_123ergjh3kjhsdf12';

    update: it looks like ann's plugin uses AUTH_COOKIE

    so in wp-config.php put

    define('AUTH_COOKIE','wordpress_123ergjh3kjhsdf12');
    Posted 2 years ago #
  5. ipswitchft
    ipswitchft

    junior member
    Joined: May '09
    Posts: 9

    offline

    hmm.. BB refuses to write the usercookie even with the bb-config setting.

    wordpress wrote the auth_cookie .. we're getting there!

    also, in wp-config i have not set sitecookiepath - when i do, i get "too many redirects". i am guessing this is because my WP install is under another directory, /main/.

    sorry for all the hassle here!

    Posted 2 years ago #
  6. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 882

    offline

    You need to define

    define('COOKIEPATH','/');
    define('SITECOOKIEPATH','/');

    in your wp-config.php
    if the cookie is not being set to / by default

    Posted 2 years ago #
  7. ipswitchft
    ipswitchft

    junior member
    Joined: May '09
    Posts: 9

    offline

    I have now added SITECOOKIEPATH but was only able to prevent the Redirect Loop issue by adding ADMIN_COOKIE_PATH . I noticed though, that I then get two WORDPRESS_123873843 cookies set.. and BB still does not know what to do.

    I am going to post my Configs here.. I'm probably missing something blatant!

    Posted 2 years ago #
  8. ipswitchft
    ipswitchft

    junior member
    Joined: May '09
    Posts: 9

    offline

    <?php
    /** WordPress's config file **/
    /** http://wordpress.org/ **/

    // ** MySQL settings ** //
    define('WP_CACHE', true); //Added by WP-Cache Manager
    define('DB_NAME', '###########'); // The name of the database
    define('DB_USER', '###########'); // Your MySQL username
    define('DB_PASSWORD', '###########'); // ...and password
    define('DB_HOST', '###########'); // ...and the server MySQL is running on

    // Change the prefix if you want to have multiple blogs in a single database.

    $table_prefix = '###########'; // example: 'wp_' or 'b2' or 'mylogin_'

    define('SECRET_KEY', '###########'); // Change this to a unique phrase.
    define('AUTH_COOKIE','wordpress_###########');

    // Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-includes/languages.
    // For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');

    /* Stop editing */

    $server = DB_HOST;
    $loginsql = DB_USER;
    $passsql = DB_PASSWORD;
    $base = DB_NAME;

    define('ABSPATH', dirname(__FILE__).'/');

    $wp->cookiedomain = '.filetransferplanet.com';
    define(COOKIE_DOMAIN,'.filetransferplanet.com');
    define('COOKIEPATH', '/');
    define('ADMIN_COOKIE_PATH', '/');
    define('SITECOOKIEPATH', '/');

    // Get everything else
    require_once(ABSPATH.'wp-settings.php');
    ?>

    Posted 2 years ago #
  9. ipswitchft
    ipswitchft

    junior member
    Joined: May '09
    Posts: 9

    offline

    and BBpress..

    <?php
    //require_once('../wp-blog-header.php');
    // ** MySQL settings ** //
    define('BBDB_NAME', '#######'); // The name of the database
    define('BBDB_USER', '#######'); // Your MySQL username
    define('BBDB_PASSWORD', '#######'); // ...and password
    define('BBDB_HOST', '#######'); // 99% chance you won't need to change these last few

    define('BBDB_CHARSET', 'utf8'); // If you are *upgrading*, and your old bb-config.php does
    define('BBDB_COLLATE', ''); // not have these two contstants in them, DO NOT define them
    // If you are installing for the first time, leave them here

    // Change BB_SECRET_KEY to a unique phrase. You won't have to remember it later,
    define('BB_SECRET_KEY', '#######'); // Change this to a unique phrase.

    // If you are running multiple bbPress installations in a single database,
    // you will probably want to change this.
    $bb_table_prefix = '#######'; // Only letters, numbers and underscores please!

    // Change this to localize bbPress. A corresponding MO file for the
    // chosen language must be installed to bb-includes/languages.
    // For example, install de.mo to bb-includes/languages and set BB_LANG to 'de'
    // to enable German language support.
    define('BB_LANG', '');

    /* Stop editing */

    if ( !defined('BB_PATH') )
    define('BB_PATH', dirname(__FILE__) . '/' );
    require_once( BB_PATH . 'bb-settings.php' );

    //$bb->WP_BB = true;

    $bb->wp_siteurl = 'http://www.filetransferplanet.com/main/';
    $bb->wp_home = 'http://www.filetransferplanet.com/';
    $bb->wp_table_prefix = '#######';
    $bb->user_bbdb_name = '#######';
    $bb->user_bbdb_user = '#######';
    $bb->user_bbdb_password = '#######';
    $bb->user_bbdb_host = '#######';
    $bb->custom_user_table = '#######';
    $bb->custom_user_meta_table = '#######';
    $bb->cookiedomain = '.filetransferplanet.com';
    $bb->cookiepath = '/';
    $bb->sitecookiepath = '/';

    $bb->load_options = true;

    $bb->usercookie = 'wordpress_logged_in_#######';
    $bb->authcookie = 'wordpress_#######';
    ?>

    Posted 2 years ago #
  10. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 882

    offline

    If you are using Ann's plugin, it should be using ADMIN_COOKIE_PATH at all.
    ADMIN_COOKIE_PATH is a 2.7 cookie constant, Ann's drops WP to 2.5's method.

    You sure Ann's plugin is running correct?

    Posted 2 years ago #

RSS feed for this topic

Post a reply to “BB/WP integration, but cookies seem awry.” »

You must log in to post.

keep _ck_ coding >> donate $5 <<     Theme Switcher:
44 users online from in the past 30 minutes. 16 bots 28 guests
2,915 views today 6,910 yesterday 14,010 peak. Most at once 47 today 48 yesterday 131 peak. Visited today: codye, _ck_
2,231 posts in 377 topics over 62 months by 424 of 1,966 members. Latest: brmidot, somomoni, codye