Session Variables

Discussion in 'aMember Pro v.4' started by linguaspectrum, Dec 13, 2011.

  1. linguaspectrum

    linguaspectrum Online English Teacher

    Joined:
    Apr 25, 2009
    Messages:
    39
    Does anyone know how to get the session variables in v4 when stored in the database? Are they the same as in v3?
    I've added the <?php session_start(); ?> and <?php var_dump($_SESSION);?> but only get array(0) { } as the output.
  2. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
  3. linguaspectrum

    linguaspectrum Online English Teacher

    Joined:
    Apr 25, 2009
    Messages:
    39
    Thanks Alex,
    From the helpdesk:
    Here is a code you can use
    include_once('./amember/library/Am/Lite.php');
    echo Am_Lite::getInstance()->getEmail();
    //last line will output all available data for logged in user print_r(Am_Lite::getInstance()->getIdentity());
  4. crogue

    crogue New Member

    Joined:
    Dec 17, 2011
    Messages:
    13
    I got an error when trying to access getIdentity(). Instead, I saw that the Lite.php file already stored getIdentity() in getUser(). So if you ever want to see the whole kit 'n' kaboodle:

    PHP:
    require_once '/home/user/public_html/amember/library/Am/Lite.php'
    print_r(Am_Lite::getInstance()->getUser());
    Kabam!

Share This Page