How To Get Phpbb2 & Amember To Use The Same Cookie

Discussion in 'Integration' started by Epsilon, Sep 5, 2003.

  1. Epsilon

    Epsilon Guest

    I'm wondering how this can be done. I tried changing the settings on my BBS to use the same cookie name and path as aMember Pro, but it didn't work (and I think aMember sets more than one cookie).

    Basically, I just don't want people to have to log into the BBS after already logging into aMember, because the BBS sits in my protected member area and it uses the same usernames and passwords as aMember (I bought the PHPBB2 plugin).

    Has anyone done this before?
  2. alex-adm

    alex-adm Guest

    Unfortunately, it is impossible to do what you need. phpBB stores cookie / session info via URL and don't set cookies regarding it. It is uncommon behaviour - most applications set session id in cookie, then amember can work with it and "single login" can be implemented. I wasted 2 days to make it working and it is impossible without changing phpBB code, unfortunately,
  3. aantix

    aantix New Member

    Joined:
    Sep 1, 2003
    Messages:
    23
    Just out of curiousity, is there a single login with the aMember/Invision module combination?
  4. alex-adm

    alex-adm Guest

    Yes, it does support
  5. Epsilon

    Epsilon Guest

    Ahh, when it comes to computer coding nothing is truly 'impossible'. We just haven't figured out how to do it yet. I'm sure this could be done with some creative hacking of PHPBB's code, although it might be a pain in the butt. And I realize this isn't the right place to discuss it. But I'll keep searching. If I find a solution I'll post it, as others might benefit from it.
  6. alex-adm

    alex-adm Guest

    Sure, it is possible by hacking phpBB code!
    aMember stores username and password of logged-in member at
    $_SESSION['_amember_login']
    $_SESSION['_amember_pass']

    sure, you have to call session_start() first.
  7. rodrickjae

    rodrickjae New Member

    Joined:
    Feb 20, 2006
    Messages:
    2
    phpBB2 hack

    hi, i read this thread in which you found a way to force phpBB2 to share the same cookies as aMember pro. However, i am a novice at programming and do not understand how to set it up the way you described. Do you have installation service or support on how to do this?
  8. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Latest version of phpBB plugin supports single-login and no modifications needed. Just follow the plugin readme.
  9. upsa

    upsa New Member

    Joined:
    Feb 17, 2006
    Messages:
    23
    Just curious if this works with having forum on one sub domain and amember on another?

    like: amember is at:
    members.mydomain.com

    and forum is at

    forum.mydomain.com

    Because in the code it says to edit file phpbb/profile.php, by replacing the first line.

    <?php if (($_GET['mode'] == 'register') && ($_POST['mode'] == 'register')){
    header("Location: /amember/signup.php"); exit();
    }

    The location link has it as a path. I cannot do that if it's setup on two sub domains. Or can I ?
  10. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    just change to
    PHP:
    header("Location: http://members.mydomain.com/signup.php"); exit();
  11. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Sorry, there was error in code. The code should look like:

    PHP:
    <?php if (($_GET['mode'] == 'register') || ($_POST['mode'] == 'register')){
    header("Location: /amember/signup.php"); exit();
    }
    or

    PHP:
    <?php if (($_GET['mode'] == 'register') || ($_POST['mode'] == 'register')){
    header("Location: http://members.mydomain.com/signup.php"); exit();
    }
  12. upsa

    upsa New Member

    Joined:
    Feb 17, 2006
    Messages:
    23
    Thanks Alex!

    You're psychic. I was going to email you when I got a chance to let you know I was having trouble. I really appreciate you being proactive!!

    This works well!

    It's nice to cross something off the to-do list!

    Brian

Share This Page