Skip to:
Content
Pages
Categories
Search
Top
Bottom

wp integration cookie does not work


  • alpacino85
    Member

    @alpacino85

    Hello,

    I integrated wordpress Version 2.8.6 with bbpress Version 1.0.2

    My user table is correctly shared, couse i can login on both.

    When I switch from wordpress to bbpress, I am nog logged in, if i log in on bbpress i get logged out on wordpress.

    Does any one know what i did wrong ?

Viewing 25 replies - 1 through 25 (of 47 total)

  • chrishajer
    Participant

    @chrishajer

    I wish I knew the answer. This is quickly becoming the most common integration question on the forums. Hopefully someone will post the definitive solution.


    Michael
    Member

    @michael888

    To be perfectly honest – I agree with Chris.

    This type of thing will be fixed when the next bbPress comes out – which will have a different intergration system

    Michael

    I can look at it. You just need to give me access. Email me at my username at gmail.com


    chrishajer
    Participant

    @chrishajer

    gerikg – please post what you find. Maybe it’s a simple mistake that everyone is making, or you can show how the integration documentation needs to be updated to make this easier for everyone.

    I know it’s sometimes easier to just go and fix stuff yourself instead of going back and forth in a forum trying to figure out what’s wrong, but I really do hope someone posts a procedure for integrating logins that will work for everyone. alpacino85 did what I think most reasonable people would do: download the most recent version of both software packages and then follow the latest integration instructions (even though they’re out of date), but that doesn’t seem to work. Lots of people have the same exact issue (logging into WordPress logs you our of bbPress or vice versa) so I hope there’s on little “gotcha” or “ah ha” that can be posted to take care of this for most people. Thanks.

    Chrishajer, I’ll try. There are several reasons why it doesn’t work but I’ll write it here. I usually find it and then write about it but I’ll try your way.

    1 When installing wordpress/bbpress do NOT use “www.” Example: use bbpress.org not http://www.bbpress.org and use the same database. You do not need to change the prefix, I prefer you don’t because you’ll run into problem later.

    2 Make sure bbpress is in a folder in wordpress. example: wordpress/bbpress/ not on the same level.

    3 The folder does not have to be named bbpress, most people make it forum or forums.

    *After successfully installing both programs open wp-config.php (in the wordpress folder) file. Around line # 45-# 48 you’ll see define(‘AUTH_KEY’…. go to this URL (https://api.wordpress.org/secret-key/1.1/salt) and get the EIGHT keys and REPLACE the FOUR keys that are there. Save. Keep the file open for now.

    4 Open bb-config.php (in the bbpress folder) do the same thing here. With the SAME keys you put in the wordpress file put in the bb-config file around line # 41-45. Save. Keep the file open for now.

    5 Clear your cache on your browser. Log into your bbpress dashboard and go to Settings->Wordpress Integration-> WordPress Administrator should be keymaster. Every other option should be member for now. WordPress address (URL) should be the URL again NO www. Blog address (URL) the same as before. The last 3 should be LOCKED if not repeat the steps 3&4.

    6 Login to your wordpress dashboard. Go to Plugins->Add New-> search for “bbPress Integration” it should be the first one. Install it and activate.

    7 Go to Settings-> bbPress Integration. Enter the bbPress URL without the www. Your plugins URL leave blank. Click on Save Changes. On the bottom box you’ll see some text copy it. Most likely it will say “define( ‘COOKIEPATH’, ‘/’ );”

    8 Paste the line in wp-config.php file around line # 16 (MUST be on top. Don’t know why) and paste it in bb-config.php in line # 13 (Must be on top). Save. You can delete the plugin, it’s no longer needed.

    9 Clear your cache on your browser and you’re done.

    Known Problems

    *Two different database, one for WP and one for BBP, does not always work.

    *Changing the database prefix. There are tutorials out there that tell you to do it, just don’t.

    *Hosting companies that offer free databases, have buggy databases.

    *BBpress not being in WordPress folder. I don’t think the plugin takes that into account.


    chrishajer
    Participant

    @chrishajer

    Thanks for posting that. I cannot imagine anyone who wants integration to jump through these hoops to get it to work. If someone can confirm that these steps work, maybe we can get the documentation updated here.


    chrishajer
    Participant

    @chrishajer

    gerikg, # 1 is a deal killer for me: you cannot use www for your WordPress and bbPress installation? Why is that? Problems with cookie integration? Just curious. Thanks

    If I remember correctly bbpress refuses you to put www and WordPress doesn’t care. When one has www and the other one does not the cookies don’t work.


    chrishajer
    Participant

    @chrishajer

    Got it – thanks gerikg.

    Also another problem is when you upgrade from an older version (wordpress/bbpress) the XX-config.php files are different than what you already have. Check wp-config.php against wp-config-sample.php & bb-config.php against bb-config-sample.php should be fairly simple.


    alpacino85
    Member

    @alpacino85

    Thanks for all the reply’s

    I have a question though, at step 5 what do you mean by “The last 3 should be LOCKED”

    the last three fields should be locked?

    couse in my screen i have the following fields beneeth “Blog address (URL)” field.

    *WordPress “auth” cookie salt

    This must match the value of the WordPress setting named “auth_salt” in your WordPress site. Look for the option labeled “auth_salt” in this WordPress admin page.

    *WordPress “secure auth” cookie salt

    This must match the value of the WordPress setting named “secure_auth_salt” in your WordPress site. Look for the option labeled “secure_auth_salt” in this WordPress admin page. Sometimes this value is not set in WordPress, in that case you can leave this setting blank as well.

    *WordPress “logged in” cookie salt

    Am i missing some steps ?

    WordPress “auth” cookie salt, WordPress “secure auth” cookie salt , and WordPress “logged in” cookie salt should be NOT editable (it shows a picture of a lock next to it) if they are then you messed up on step # 3.

    Here’s an image: http://s2.postimage.org/XgZt9.jpg


    Spindoctor
    Member

    @spindoctor

    Hi!

    I also try to integrate Cookies, but I don’t succeed.

    This might be due to the issue, that it’s not possible for me to follow every step of gerikgs instruction (by the way thank you for posting this instruction).

    Here’s what I did:

    my blog adress is http://www.<domain>/<home-folder>/

    my wordpress adress is http://www.<domain>/<home-folder>/wordpress/

    my bbpress adress is http://www.<domain>/<home-folder>/wordpress/bbpress/

    (As I have no write-access on <domain> or <domain>/<home-folder>/, I had to keep the “www.”.)

    Besides, I changed the table-prefixes of wordpress and bbpress to “<string>wp_” and “<string>bbpress_” when I installed wordpress and bbpress.

    To integrate bbpress-cookies with wordpress, I changed the keys in wp-config.php and bb-config.php, just as described by gerikg.

    Afterwards I changed Integration Settings in bbpress, so that WP-Admins are Keymasters in bbpress and every other role is member. (Again I had to keep the WWW in the URLs.) Sadly, the keys were not inactive…

    Then I added “define( ‘COOKIEPATH’, ‘/<home folder>/’ );” (the plugin told me to add “define( ‘COOKIEPATH’, ‘/<home folder>/wordpress/’ );”, but when I did this I had problems with the cookies in wordpress itself, so I removed “wordpress/”)

    Maybe that’s not surprising, but Cookie-Integration still doesn’t work.

    I there a way to get Cookie-Integration working, with this setup?

    Thank you for your help!!!


    Spindoctor
    Member

    @spindoctor

    (sorry for the strange signs inside of the pseudo-links. it should be “<” or “>”)

    in WP go to /<home-folder>/wp-admin/options.php

    check that everywhere you see the url has the www

    Then go to your BBpress admin and click on Options check bbPress address (URL) see if the www is there.

    try define( 'COOKIEPATH', '/<home folder>/wordpress/' ); first. Clear you cache after doing this. Then login and test it out.

    if not.. then I ran out of ideas.


    Spindoctor
    Member

    @spindoctor

    Thank you for your help!

    I finally made it!

    I learned a lot about cookies and databases, but in fact, after 2 days, the problem was easy to solve:

    After copying those 8 keys to my wp-config.php, I copied THE SAME lines to my bb-config.php. It took me quite a long time to find out, that most variables in bbpress have “BB_” in the front.

    After renaming “AUTH_KEY” to “BB_AUTH_KEY” and so on, everything was working as supposed.

    Maybe pointing this fact out would make this instruction even more foolproof!?

    Thank you for your help!!!!

    Spindoctor

    SpinDoctor, OMG i can’t believe I forgot!!!! thank you I was going insane.

    1 When installing wordpress/bbpress do NOT use “www.” Example: use bbpress.org not http://www.bbpress.org and use the same database. You do not need to change the prefix, I prefer you don’t because you’ll run into problem later.

    2 Make sure bbpress is in a folder in wordpress. example: wordpress/bbpress/ not on the same level.

    3 The folder does not have to be named bbpress, most people make it forum or forums.

    *After successfully installing both programs open wp-config.php (in the wordpress folder) file. Around line # 45-# 48 you’ll see define(‘AUTH_KEY’…. go to this URL (https://api.wordpress.org/secret-key/1.1/salt) and get the EIGHT keys and REPLACE the FOUR keys that are there. Save. Keep the file open for now.

    4 Open bb-config.php (in the bbpress folder) do the same thing here. With the SAME keys you put in the wordpress file put in the bb-config file around line # 41-45. You have to add BB_ to the front of the names. Example: BB_AUTH_KEY to all eight. Save. Keep the file open for now.

    5 Clear your cache on your browser. Log into your bbpress dashboard and go to Settings->Wordpress Integration-> WordPress Administrator should be keymaster. Every other option should be member for now. WordPress address (URL) should be the URL again NO www. Blog address (URL) the same as before. The last 3 should be LOCKED if not repeat the steps 3&4.

    6 Login to your wordpress dashboard. Go to Plugins->Add New-> search for “bbPress Integration” it should be the first one. Install it and activate.

    7 Go to Settings-> bbPress Integration. Enter the bbPress URL without the www. Your plugins URL leave blank. Click on Save Changes. On the bottom box you’ll see some text copy it. Most likely it will say “define( ‘COOKIEPATH’, ‘/’ );”

    8 Paste the line in wp-config.php file around line # 16 (MUST be on top. Don’t know why) and paste it in bb-config.php in line # 13 (Must be on top). Save. You can delete the plugin, it’s no longer needed.

    9 Clear your cache on your browser and you’re done.

    Known Problems

    *Two different database, one for WP and one for BBP, does not always work.

    *Changing the database prefix. There are tutorials out there that tell you to do it, just don’t.

    *Hosting companies that offer free databases, have buggy databases.

    *BBpress not being in WordPress folder. I don’t think the plugin takes that into account.

    *When you upgrade from an older version (wordpress/bbpress) the XX-config.php files are different than what you already have. Check wp-config.php against wp-config-sample.php & bb-config.php against bb-config-sample.php should be fairly simple.


    nickstevens
    Member

    @nickstevens

    @gerikg: I had pretty much given up on this an age ago after trying every listed trick on these forums at the time. Your solution worked flawlessly, so thank you very much! :)

    +1

    the addition of BB_ in step 4 worked perfect for me (been trying to integrate for the last week).

    Thanks folks.

    (in my case I didn’t leave out www in step 1, 5 or 7)

    WPv2.8.6 BBv1.0.2

    Ohh dear, seems I gushed too soon.

    While the above does log me into bbpress once I’m logged into WP, when I click on the “Admin” link I get redirected back to the main form page. Only when I log out of bbpress and log back in again does the “Admin” link take me to the admin page.

    I’m away to try dropping my ‘www’s

    @nickstevens, welcome, I’m glad I can help.

    @chrishajer, it works, now what?


    johnhiler
    Member

    @johnhiler

    @ChuckMcB -Hmm, since you can access the admin link while signed into bbPress, it’s probably not a case where you lost your admin access:

    http://bbpress.org/plugins/topic/fix-admin-access/

    It sounds like you may be onto something with the www issue you mentioned… one cookie is setting itself on www, while the other one is not.


    thierryyyyyyy
    Member

    @thierryyyyyyy

    I think this could be a “sticky” topic !

    I don’t understand the need of having the forum in a subdirectory of the blog. As I did it years ago, I can’t change that now. I succeeded years ago to make a cookies integration plugin (that was before wp 2.6 I think), and I remember that the blocking thing was the “cookie path” and “cookie host”.

    My WP is on http://www.2diabolos.com/blog/

    my BB is on http://forum.2diabolos.com

    (I hear you thinking “OMG, 2 different subdomains !!!”)

    Now, I succeed to have the good “cookie domain” (I think the definition is the define( 'COOKIE_DOMAIN', '.2diabolos.com ' ); )

    But the define( 'COOKIEPATH', '/' );does NOT work as it should. WP then define each of cookie twice with the “/” path and with the “/blog/” path (my WP path).

    The straightforward consequence is that : When I log in WP, I’m also logged in BB (double cookies!).

    But when I log out from BB, he deletes only the “/” cookies, so I’m still logged into WP.

    Worse : when I’m logged only in BB (cookies path “/”), WP does not recognize me as logged in.

    He only checks the “/blog/” path ? (even with define( 'COOKIEPATH', '/' ); in the wp-config.php )

    Well, I’m totally confused. I followed all the steps in gerikgs explaination. The links from my WP lead through to my forum…..but

    bbpress doesn’t seem to bring the user logon details from the main site.

    The bbpress is not inside the wordpress folder because wordpress is the main site.

    any Ideas would be greatly appreciated.

    BB Press would work better as a plugin for wordpress.just my opinion.


    chrishajer
    Participant

    @chrishajer

    What is the URL of your forum and site?

Viewing 25 replies - 1 through 25 (of 47 total)

You must be logged in to reply to this topic.