I display conditional login links and text on every page depending on whether a user is logged in. The relevant code is straight out of the FAQ. Code: <?php session_start(); // Very first line of code ?> ~~~~~~~~~~~~~~~~~~ <?php // Populate amemuser, run code to display welcome link if ($amemuser=$_SESSION['_amember_user']){ // logged-in print "Welcome, $amemuser[login] | "; print "<a href='/amember/logout.php'>Logout</a>"; } else { // user is not logged-in print "<a href='/amember/login.php'>Login</a>"; } ?> This works fine. However, if a user who has checked "Remember my password" closes the browser and returns, the code does not detect the returning user. If the user clicks on the 'login' link they are automatically logged in using the account stored in the cookie. It appears to me that session_start is not sufficient to populate $_SESSION['_amember_user'] with the returning users data. Once amember is invoked by going to a login screen the cookies are read and the user is authenticated. Is there an amember script I can 'hit' to refresh cookies if I detect these variables are not set? Why is this not working? I should add I am using the wordpress plugin and am running a wordpress site but I don't think that makes a difference here. All other wordpress integration is working fine. I searched the forums extensively - I am surprised I am the only one with this issue. Thanks in advance.
From Amember support: You need to include this code at the top of your pages where you have your code: include "/full/path/to/amember/plugins/protect/php_include/reload_if_cookie.inc.php"; This will restore session variables from cookies. ... and it works like a charm.