User ID tracking in my PHP scripts + 'new_rewrite' Impossible?

Discussion in 'Customization & add-ons' started by Arsenit, May 3, 2006.

  1. Arsenit

    Arsenit New Member

    Joined:
    May 3, 2006
    Messages:
    1
    Hello everybody!
    I need to track usage of my php scripts by registered members.

    aMember manual says, that I need to use this variable:
    Code:
    $_SESSION[ '_amember_user' ][ 'member_id' ]
    But!!!
    It has '0'or is undefined in some cases when 'new_rewrite' is used. The strange thing is that amember still lets user see and reload protected scripts.

    I've tried folowing vars in my tracker function:

    Code:
    $HTTP_SESSION_VARS['_amember_id']
    - gives less 'Untracked' members but still not 100% perfect.

    Code:
    $HTTP_SESSION_VARS['_amember_login'] 
    $HTTP_COOKIE_VARS['_amember_ru']
    $HTTP_SESSION_VARS['_amember_id']
    Give not much help either.

    Sure I'm using
    Code:
    session_start() 
    //and 
    global $HTTP_COOKIE_VARS, $HTTP_SESSION_VARS, $_SESSION;
    

    Is there any way to get user_id or login in php script in prodected dir (with new_rewrite) in 100% of times when he is loading/reloading this script?
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    $HTTP_SESSION_VARS['_amember_id']
    is set for sure if customers is logged-in. You may check that. It does not depend on customer browser or settings.

Share This Page