Attempting to check multiple products/set session

Discussion in 'Troubleshooting' started by toddhenry, Feb 16, 2009.

  1. toddhenry

    toddhenry New Member

    Joined:
    Sep 5, 2006
    Messages:
    9
    I'm having a difficult time checking for multiple products to set amember session. The 'free' works great, but the 'premium' does not work in the below scenario. Any help? Thanks. (I should also add that when I only use one product for premium, say '14', it works fine.)

    <?php
    //var_dump($_SESSION);
    if ($_SESSION[_amember_product_ids]) {
    if (in_array(array('12','14','2','3','4','5'),$_SESSION[_amember_product_ids]))


    {
    //Premium User
    $_SESSION['am_user_type'] = 'premium';


    } else if (in_array('15',$_SESSION[_amember_product_ids])) {
    //Free User
    $_SESSION['am_user_type'] = 'free';

    } else if (is_user_logged_in()) {
    //Wordpress Only User
    $_SESSION['am_user_type'] = 'wordpress';

    } else {
    //Not Logged In
    unset($_SESSION['am_user_type']);
    }
    }
    ?>

Share This Page