Skip to:
Content
Pages
Categories
Search
Top
Bottom

bb_is_user_logged_in() fails on non-BB page

  • I’m trying to protect page on another subdomain… but unfortunately bbPress is not authenticating the cookie. (they are set for .domainabc.net)

    for test.domainabc.net:
    Cookie: bbpress_logged_in_00aa30280fe74d40ca269b5b2efffba3=rich%7C1247421898%7Cfbd785e0974af74814b56550af9c49dc

    for forums.domainabc.net
    Cookie: bbpress_logged_in_00aa30280fe74d40ca269b5b2efffba3=rich%7C1247421898%7Cfbd785e0974af74814b56550af9c49dc

    on test.domainabc.net i have something like this:

    require_once ('../forums.domainabc.net/bb-load.php');

    function add_allowed_redirect_hosts() {
    $allowed_redirects = array('test.domainabc.net');
    return $allowed_redirects;
    }
    add_filter('allowed_redirect_hosts', 'add_allowed_redirect_hosts');

    bb_auth( 'auth' );

    It will properly redirect to the login page, enter info, redirect back to test.domainabc.net – but then it will issue another 302 redirect back to forums.domainabc.net.

    and if i place a die statement within this bb_auth else on test.domainabc.net it will echo

    if ( 'auth' === $scheme && !bb_is_user_logged_in() ) {
    //redirects fine to login page the first time...
    } else {
    //echo - this happens when returning a 2nd time
    }

    BUT… if i return to forums.domainabc.net i’m logged in… and everything works.

  • You must be logged in to reply to this topic.
Skip to toolbar