theozsnowman Posted May 23, 2022 Share Posted May 23, 2022 we have noticed recently that some of our admins get logged out regularly from the admin, despite having ticked save login, and setting the ticket page refresh to 5 minutes. we have been trying to identify what's been causing this and haven't had much luck, its definitely not a browser issue as the users with the issue have tried from multiple browsers, and its not connections changing sessions or IP's as they are all on stable connections with static IP addresses, and 2 different users in the same LAN have different results, one machine stays logged in without issue and another identical machine keeps logging that user out. the cPanel server running the install is not running Nginx (as we found that no one could stay logged in with that deployed) We do run both IPv4 and 6 on the server and the users are on a mix of ipv4 and 6 external connections anyone experienced anything odd like this or know of a way to try and identify the cause as its really annoying 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted May 25, 2022 WHMCS Support Manager Share Posted May 25, 2022 Hi @theozsnowman, Do you have any sort of proxy, load-balancer or WAF in front of your webserver, like NGNIX or Cloudflare/Cloudfront? If so, configuring the Trusted Proxy settings will help: https://docs.whmcs.com/Trusted_Proxy_Settings Second, check the Configuration > System Logs > Admin Log. Are the IPs of your admins changing mid-session? If so, that would explain the need to re-authenticate. Finally, there could be an issue with PHP Sessions on the environment. Switching to Database Session Handling can often workaround such issues: https://docs.whmcs.com/Sessions#Database_Sessions 0 Quote Link to comment Share on other sites More sharing options...
theozsnowman Posted May 25, 2022 Author Share Posted May 25, 2022 no we found that this install for some odd reason would not run under NginX ...it would just log you straight out instantly as soon as you logged in... our admins are all running on Static IP connections, some on ipv4 some on ipv6, and 2 of the users machines are on the same local network, one works the other doesnt 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted May 26, 2022 WHMCS Support Manager Share Posted May 26, 2022 Hi @theozsnowman Does the admin log reflect the static IP, or is it changing? Did Database Session Storage make a difference? 0 Quote Link to comment Share on other sites More sharing options...
theozsnowman Posted May 29, 2022 Author Share Posted May 29, 2022 John the log is showing the correct Static IP's ive only just switched t the Database session storage so I'll see what happens over the next hour... 0 Quote Link to comment Share on other sites More sharing options...
theozsnowman Posted May 30, 2022 Author Share Posted May 30, 2022 (edited) no joy unfortunately... i myself am still getting logged out repeatedly... would a server config issue cause this? i know we have never been able to get WHMCS to work on this server with NginX as it logs everyone out repeatedly every time you change a page... so we went back to just apache... another install i run on a different but identically setup server works fine with NginX and doesnt create the same logout issues... Edited May 30, 2022 by theozsnowman 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted June 1, 2022 WHMCS Support Manager Share Posted June 1, 2022 Hi @theozsnowman, Really the only software-related setting which could impact this, is if the session name is being overwritten. Please ensure there aren't any entries in your configuration.php file like: session_name("$value"); The final test to perform is to observe the PHP Session ID before and after the issue occurrs. You can unzip and use the attached sessiontest.php Test Script file to check that PHP sessions are working correctly on your server. Login to the WHMCS Admin area. Visit in your browser and fresh a couple of times. The count number should increase incrementally by 1 each time. Note down the session ID value. Now open a new tab and do your usual WHMCS Admining tasks. When you're logged out, switch back to the tab with Sessiontest.php open and refresh. Observe the Session ID value, has it changed? If the Session ID has been changed, this indicates that for some reason your server's PHP configuration has cleared out the session, which would need further investigation at the server level. sessiontest.zip 0 Quote Link to comment Share on other sites More sharing options...
theozsnowman Posted June 2, 2022 Author Share Posted June 2, 2022 John thanks.. there is no session_name("$value"); in the config and i set the sessions to save in the databade.. i got logged out and your script showed the session changed: Array ( [tkval] => oZlDgUQ0XQ2X [adminid] => 1 [adminpw] => 45b43199d0cfd32ca7e7a81c8e5a3cba6e12d8e2 [adminSqlStrictModeCheck] => 1654134969 [count] => 1 ) PHP session.save_path /var/cpanel/php/sessions/ea-php74 is writable Array ( [tkval] => oZlDgUQ0XQ2X [adminid] => 1 [adminpw] => 45b43199d0cfd32ca7e7a81c8e5a3cba6e12d8e2 [adminSqlStrictModeCheck] => 1654134969 [count] => 2 [FeatureHighlightsSeenForVersion] => 8.4.0-rc.1 ) PHP session.save_path /var/cpanel/php/sessions/ea-php74 is writable Array ( [tkval] => yHxYmNRHNw2A [count] => 1 ) PHP session.save_path /var/cpanel/php/sessions/ea-php74 is writable this was after about 15 mins of being actively in the site 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted June 2, 2022 WHMCS Support Manager Share Posted June 2, 2022 Hi @theozsnowman, The session ID (tkval) changing, is the cause of the logout. This will happen in two scenarios: A period of inactivity greater than your PHP.ini's session.gc_maxlifetime time. Try increasing the value or check the "Remember Me" checkbox when logging in. Triggering the PHP session_unset or session_destroy function. In a stock WHMCS installation this would only happen when clicking the Logout link, but it's possible an after-market customisation is using these functions and ending the admin session. 0 Quote Link to comment Share on other sites More sharing options...
theozsnowman Posted June 2, 2022 Author Share Posted June 2, 2022 The remember me function makes no difference, and i have the tickets screen refresh set to 5 mins. Its just weird that 2 machines on the same local lan have different results and other admins on remite connections dont have the issue, and my oen remote connection has the issue to wheras my machine in our office doesnt gc_maxlifetime is set to 3600 0 Quote Link to comment Share on other sites More sharing options...
theozsnowman Posted June 28, 2022 Author Share Posted June 28, 2022 still no joy in finding a solution to this issue.. as soon as we enable engintron it just keeps randomly logging us out when we change pages in the admin. Turn NginX off and it behaves as it should I have run a diff of all the whmcs files against a second installation which doesnt have the issue and found nothing odd both servers are running identically configured WHM, Apache and Engintron installations as well, and we have been thru every whm setting and compared... still no joy 😞 0 Quote Link to comment Share on other sites More sharing options...
developer _WHM_CS Posted July 14, 2022 Share Posted July 14, 2022 On 6/29/2022 at 3:13 AM, theozsnowman said: still no joy Hello active mod_remoteip.c on Apache then add following code to httpd.conf RemoteIPHeader X-Forwarded-For RemoteIPTrustedProxy XX.XX.XX.XX/32 XX.XX.XX.XX is Nginx IP also, use database for Session 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.