Skip to:
Content
Pages
Categories
Search
Top
Bottom

Cookies and WPMU

  • @mozey

    Member

    i managed to get bb and mu working from mu’s users tables THANK GOD. Now, i need them to have the same sessions,

    “name $bb->usercookie USER_COOKIE

    name $bb->passcookie PASS_COOKIE

    path $bb->cookiepath COOKIEPATH

    path $bb->sitecookiepath SITECOOKIEPATH

    domain $bb->cookiedomain COOKIE_DOMAIN”

    (documentation)

    SO, what would the code look like in my config.php?

    $bb->passcookie = $wp->{‘PASS_COOKIE’}; ?

    ..

    This is not workig as nice. any clues?

Viewing 12 replies - 1 through 12 (of 12 total)
  • @mdawaffe

    Member

    $bb->passcookie = PASS_COOKIE

    Might work if you load wp before you load bb.

    Is your bbPress URL a sudbirectory of your mu URL? If so, you should be able to use the $bb->wp_home and $bb->wp_siteurl variables.

    @mozey

    Member

    well it is a subdirecotry. and thank you, however,

    $bb->passcookie = PASS_COOKIE;?

    is not working.

    @mozey

    Member

    what i need done is for someone to log into thier mu account, and not to have to login again to post in my forums.

    @mdawaffe

    Member

    In bbPress, where and how are you loading wpmu?

    Are your mu blogs set up like someblog.example.com or example.com/someblog?

    @mozey

    Member

    mdawaffe, thanks for the response, okay,

    example.com/someblog

    my forum is in example.com/forums

    i’m not loading wpmu, i was using at a point of time

    MU_BB was true,

    include_once(‘wp-config’)

    (the syntax was right)

    However, i took that off since it was messing up my template, it was assuming that /forums is someone that wanted to register.

    should i solve that issue FIRST? if so, any ideas? :)

    however, back to main topic, what should i play with in order to share the sessions?

    @mdawaffe

    Member

    Try this.

    Look at the cookie you have from you mu site. (In firefox: preferences -> privacy -> cookies -> view cookies then find the cookie in question. I’m sure there’s a way to do this in other browsers as well.)

    I bet it looks like this:

    Name: wordpressuser

    Domain: example.com // or is it .example.com ?

    Path: /

    Send For: Any type of connection

    And one for the password too:

    Name: wordpresspass

    Domain: example.com

    Path: /

    Send For: Any type of connection

    If that is the case, in bbPress’ config.php set the following.

    $bb->usercookie = ‘wordpressuser’;

    $bb->passcookie = ‘wordpresspass’;

    $bb->cookiedomain = ‘example.com’; // or .example.com if there was a . above

    $bb->cookiepath = ‘/’;

    If I’m wrong in my guess about the structure of yrour cookies, please post what they are (name, domain, path, send for only. Don’t post the content of the cookie).

    @mozey

    Member

    PERFECT,

    @suleiman

    Member

    mozey, would you mind helping out a fellow mu’er and post the code to your working mu/bbpress integration?

    I’ve been stumbling again and again on getting the user integration to work, let alone the cookies!

    @mozey

    Member

    suleinman, sure thing,

    okay, first of all, my bb and my mu are sharing ONLY the usertable and the login sessions. THATS IT, no common functions, nothing like that.

    and in order to do that, i added the following lines to my config.php on my bb.

    __________________________________________________

    //These are for the information about the database into which bbPress should store its content

    // ** MySQL settings ** //

    define(‘BBDB_NAME’, ‘bbdbname’); // The name of the database

    define(‘BBDB_USER’, ‘bbdbuser’); // Your MySQL username

    define(‘BBDB_PASSWORD’, ‘bbdbpassword’); // …and password

    define(‘BBDB_HOST’, ‘127.0.0.1’); // 99% chance you won’t need to change this value

    // This is the information about mu’s database. bbPress will look for users in this database

    define(‘USER_BBDB_NAME’, ‘mudbname’);

    define(‘USER_BBDB_USER’, ‘mudbuser’);

    define(‘USER_BBDB_PASSWORD’, ‘mudbpass’);

    define(‘USER_BBDB_HOST’, ‘127.0.0.1’);

    //if your using one database, its cool, just replicate the mu/bb data!

    //now your about to tell bb to look for users in the wp table

    define(‘CUSTOM_USER_TABLE’, ‘wp_users’);

    define(‘CUSTOM_USER_META_TABLE’, ‘wp_usermeta’);

    //and now, your about to tell bb to user the same sessions as wp

    $bb->usercookie = ‘wordpressuser’;

    $bb->passcookie = ‘wordpresspass’;

    $bb->cookiedomain = ‘localgigs.fm’; // or .example.com if there was a . above

    $bb->cookiepath = ‘/’;

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

    __________________________________________________

    i hope this helps. do reply back with questions, :)

    @mozey

    Member

    oh yeahh, i forgot to mention, i’m not even going to bother with the BB user table for anything!. I can get it to the point where i log in using one portals for both platforms, but i have’nt tested it beyond that.

    @suleiman

    Member

    here’s one problem mozey, you can’t access the admin backend of bbpress anymore after you’ve done this trick!

    I’m signed in as my site admin, and although WPMU recognizes me as the admin, BBPress does not.

    @mozey

    Member

    i SOMEHOW want to include my bb back end at my wp-admin in a submenue. it should be a matter of using the right include statment in a plugin that creates a new admin submenue. I have’nt done it yet, i’ll post the plugin whenever i get it done. it should’nt be much work (in thoery).

    anyone did this you guys, please let us know.

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Skip to toolbar