I've read the manual about SESSIONS and using amember's values. I really need to use the "member_id" one, and I know exactly how to get it, but when I do this: PHP: echo "<pre>"; print_r($_SESSION); echo "</pre>"; It's blank! I'm logged into the site too. I've also tried this: PHP: include ("../amember/plugins/protect/php_include/reload_if_cookie.inc.php"); HELP?
Hi David, Yes I put that at the top. It's very odd. I did move to a new server, but it worked fine on the old one. I asked the tech support on the new one if they put the session variables in some odd place. He said they're in the normal spot.
No prob, here you go: (ignore some of the stuff on the page as I've been trying anything). PHP: <?php session_start(); include ("../amember/plugins/protect/php_include/reload_if_cookie.inc.php"); $au=$_SESSION['_amember_user']; if($au==""){ //include "/home/ppccoach/domains/ppc-coach.com/public_html/amember/plugins/protect/php_include/reload_if_cookie.inc.php"; //include "/home/ppccoach/domains/ppc-coach.com/public_html/amember/plugins/protect/php_include/reload_if_cookie.inc.php"; $au = $_COOKIE['_amember_user']; } $_SESSION[firstname] = $au[name_f]; extract($_REQUEST); if(!isset($_SESSION['firstname'])){ include "/amember/plugins/protect/php_include/reload_if_cookie.inc.php"; $_SESSION['firstname'] = $au['name_f']; $_SESSION['member_id'] = $au['member_id']; } /* echo "<pre>"; print_r($au); echo "</pre>"; $au=$_SESSION['_amember_user']; if($au==""){ $au = $_COOKIE['_amember_user']; } $_SESSION[firstname] = $au[name_f]; extract($_REQUEST); if(!isset($_SESSION['firstname'])){ include ("/amember/plugins/protect/php_include/reload_if_cookie.inc.php"); $_SESSION['firstname'] = $au['name_f']; $_SESSION['member_id'] = $au['member_id']; } echo dirname(__FILE__)."<BR>"; echo $_SESSION['member_id']." and ".$au['member_id']."<BR>"; */ echo "AU<BR>"; echo "<pre>"; print_r($au); echo "</pre>"; echo "SESSION<BR>"; echo "<pre>"; print_r($_SESSION); echo "</pre>"; echo "COOKIE<BR>"; echo "<pre>"; print_r($_COOKIE); echo "</pre>"; echo "REQUEST<BR>"; echo "<pre>"; print_r($_REQUEST); echo "</pre>"; echo "amember_nr<BR>"; echo "<pre>"; print_r($_REQUEST['amember_nr']); echo "</pre>"; ?>
Go back to the beginning and save the following as a file called say variables. PHP: <?php session_start(); ?><pre><?phpprint_r($_SESSION); ?> Now access your site, log in and then in a new window call up the file variables.php and post back what you get. I think your coding is a bit suss just want to check with above.
Do you have file with that code inside aMember folder? Or in different folder? If in different, try to place that fle into ammeber folder and test again.
I'm having the same problem. Session variables are not available when check.inc.php is called. (plugins/protect/php_include/check.inc.php). Even more strange, the session cannot be detected anywhere else on the site unless the user visits member.php. In my case, I have a login box which displays "hello username...etc" if the user is logged in. If they are logged out, it shows a login form. The problem is if the member doen't have an active subscription, he then appears to be logged out automatically. Is this a known bug?