V3 to V4 session info for login user not working anymore.

Discussion in 'Templates customization' started by raymonda_komar, Feb 7, 2015.

  1. raymonda_komar

    raymonda_komar New Member

    Joined:
    Aug 22, 2006
    Messages:
    9
    Just upgraded from V3 to V4 and have been using session to get members info after login like this:

    <?php
    session_start();
    print "Welcome " . $_SESSION['_amember_user']['name_f'] . " " . $_SESSION['_amember_user']['name_l'];
    ?>
    <br>
    <?php
    $expire = "---"; // not defined
    foreach ($_SESSION['_amember_subscriptions'] as $p){
    if ($p['completed']) {
    $expire = $p['expire_date'];
    }
    }
    print "<br>Your Membership Expires on:<br><br>" . date('m/d/Y', strtotime($expire));


    ?>

    As this is not working I expect there is different method of code that retrieve this information upon login.

    Any help is greatly appreciated.

    Thanks
  2. thehpmc

    thehpmc aMember Pro Customer

    Joined:
    Aug 24, 2006
    Messages:
    901
    Forget how you did it with V3 is best advise V4 is written completely differently.

    With V4 look here http://www.amember.com/docs/API/Lite for some of the ways to retrieve user information.

Share This Page