Metahuman Network Posted December 23, 2019 Share Posted December 23, 2019 Hello all! I'm trying to get user logged-in status/session from OUTSIDE of WHMCS. I'm using latest apache, php 7.2 and WHMCS 7.8.3. Site is on example.com and WHMCS is portal.example.com. WHMCS directory is a subdirectory within the root of the main site ie example.com/account-management/ Using Code: <?php require("init.php"); $ca = new WHMCS_ClientArea(); $userid = $ca->getUserID() ; If ($userid > 0) { $loggedin = true; } else { $loggedin = false; } if ($loggedin) { echo "Logged in"; } else { echo "Not logged in"; } ?> When calling the file directly from portal.example.com It shows as expected when logged in. When accessing from trying to poll getuserid.php (above code) from main site or via sub-directory, result is always 0/Logged out. I'm sure it's an Apache or WHMCS permissions issue that my tired brain is overlooking. Thanks! ❤️ 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.