Jump to content

random logout issues for admins


Recommended Posts

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

Link to comment
Share on other sites

  • WHMCS Support Manager

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by theozsnowman
Link to comment
Share on other sites

  • WHMCS Support Manager

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.

  1. Login to the WHMCS Admin area.
  2. 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.
  3. Now open a new tab and do your usual WHMCS Admining tasks.
  4. When you're logged out, switch back to the tab with Sessiontest.php open and refresh.
  5. 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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi @theozsnowman,

The session ID (tkval) changing, is the cause of the logout.

This will happen in two scenarios:

  1. 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.
  2. 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.

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 weeks later...

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 😞

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated